tailscale/cmd/tailscaled
Joe Tsai 1f7479466e
util/deephash: use sha256x (#5339)
Switch deephash to use sha256x.Hash.

We add sha256x.HashString to efficiently hash a string.
It uses unsafe under the hood to convert a string to a []byte.
We also modify sha256x.Hash to export the underlying hash.Hash
for testing purposes so that we can intercept all hash.Hash calls.

Performance:

	name                 old time/op    new time/op    delta
	Hash-24                19.8µs ± 1%    19.2µs ± 1%  -3.01%  (p=0.000 n=10+10)
	HashPacketFilter-24    2.61µs ± 0%    2.53µs ± 1%  -3.01%  (p=0.000 n=8+10)
	HashMapAcyclic-24      31.3µs ± 1%    29.8µs ± 0%  -4.80%  (p=0.000 n=10+9)
	TailcfgNode-24         1.83µs ± 1%    1.82µs ± 2%    ~     (p=0.305 n=10+10)
	HashArray-24            344ns ± 2%     323ns ± 1%  -6.02%  (p=0.000 n=9+10)

The performance gains is not as dramatic as sha256x over sha256 due to:
1. most of the hashing already occurring through the direct memory hashing logic, and
2. what does not go through direct memory hashing is slowed down by reflect.

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2022-08-11 17:44:09 -07:00
..
childproc cmd/tailscaled/childproc: add be-child registration mechanism 2022-02-24 14:20:20 -08:00
debug.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
depaware.txt util/deephash: use sha256x (#5339) 2022-08-11 17:44:09 -07:00
install_darwin.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
install_windows.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
proxy.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
required_version.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
ssh.go all: gofmt all 2022-04-29 13:06:04 -07:00
tailscaled_bird.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
tailscaled_notwindows.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
tailscaled_test.go cmd/tailscaled: add a no-op test for profiling init-time memory allocs 2022-02-24 14:58:12 -08:00
tailscaled_windows.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
tailscaled.defaults cmd/tailscaled: rename relaynode reference in defaults file comment 2020-03-13 14:38:04 -07:00
tailscaled.go all: require Go 1.19 2022-08-02 11:49:01 -07:00
tailscaled.openrc tstest/integration/vms: use an in-process logcatcher (#2360) 2021-07-08 14:39:45 -04:00
tailscaled.service cmd/tailscaled: set StateDirectoryMode=0700 in tailscaled.service 2021-09-28 09:09:24 -07:00
with_cli.go cmd/tailscaled: add opt-in support for linking CLI into daemon 2022-07-27 11:15:52 -07:00