You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/net
Josh Bleecher Snyder efad55cf86 net/packet: speed up packet decoding
The compiler is failing to draw the connection between
slice cap and slice len, so is missing some obvious BCE opportunities.
Give it a hint by making the cap equal to the length.
The generated code is smaller and cleaner, and a bit faster.

name              old time/op    new time/op    delta
Decode/tcp4-8       12.2ns ± 1%    11.6ns ± 3%  -5.31%  (p=0.000 n=28+29)
Decode/tcp6-8       12.5ns ± 2%    11.9ns ± 2%  -4.84%  (p=0.000 n=30+30)
Decode/udp4-8       11.5ns ± 1%    11.1ns ± 1%  -3.11%  (p=0.000 n=25+24)
Decode/udp6-8       11.8ns ± 3%    11.4ns ± 1%  -3.08%  (p=0.000 n=30+26)
Decode/icmp4-8      11.0ns ± 3%    10.6ns ± 1%  -3.38%  (p=0.000 n=25+30)
Decode/icmp6-8      11.4ns ± 1%    11.1ns ± 2%  -2.29%  (p=0.000 n=27+30)
Decode/igmp-8       10.3ns ± 0%    10.0ns ± 1%  -3.26%  (p=0.000 n=19+23)
Decode/unknown-8    8.68ns ± 1%    8.38ns ± 1%  -3.55%  (p=0.000 n=28+29)
5 years ago
..
dnscache net/dnscache, control/controlclient: use DNS cache when dialing control 5 years ago
interfaces net/interfaces: ignore bogus proxy URLs from winhttp [windows] 5 years ago
netcheck net/netcheck: remove unused DNSCache from netcheck 5 years ago
netns net/netns: don't bind to device for localhost connections 5 years ago
netstat net/netstat: start of new netstat package, with Windows for now 5 years ago
nettest scripts: add a license header checker. 6 years ago
packet net/packet: speed up packet decoding 5 years ago
stun net/stun: Fix STUN attribute padding (#710) 5 years ago
tlsdial net/tlsdial, derp/derphttp: finish DERPNode.CertName validation 6 years ago
tsaddr tsaddr: add helpers for the Tailscale IPv6 range, and 4to6 conversion. 5 years ago
tshttpproxy net/tshttpproxy: aggressively rate-limit error logs in Transport.Proxy path 5 years ago