
Brad FitzpatrickandBrad Fitzpatrick
e18c3a7d84
wgengine: optimize isLocalAddr a bit
On macOS/iOS, this removes a map lookup per outgoing packet.
Noticed it while reading code, not from profiles, but can't hurt.
BenchmarkGenLocalAddrFunc
BenchmarkGenLocalAddrFunc/map1
BenchmarkGenLocalAddrFunc/map1-4 16184868 69.78 ns/op
BenchmarkGenLocalAddrFunc/map2
BenchmarkGenLocalAddrFunc/map2-4 16878140 70.73 ns/op
BenchmarkGenLocalAddrFunc/or1
BenchmarkGenLocalAddrFunc/or1-4 623055721 1.950 ns/op
BenchmarkGenLocalAddrFunc/or2
BenchmarkGenLocalAddrFunc/or2-4 472493098 2.589 ns/op
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-28 21:23:25 -07:00
..
2021-03-24 09:50:01 -07:00
2021-03-26 23:15:22 -07:00
2021-03-26 09:16:43 -07:00
2021-03-26 23:15:22 -07:00
2021-03-26 22:01:55 -07:00
2021-03-24 10:39:58 -07:00
2021-02-23 09:01:58 -08:00
2021-02-09 21:09:24 -08:00
2021-03-26 23:15:22 -07:00
2021-03-28 21:23:25 -07:00
2021-03-28 21:23:25 -07:00
2021-03-27 09:27:11 -07:00
2021-03-25 17:41:51 -07:00
2021-03-25 17:41:51 -07:00