tailscale/cmd
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
..
addlicense cmd/addlicense: add command to add licenseheaders to generated code 2021-07-19 15:31:56 -07:00
cloner cmd/{cloner,viewer}: add support for map values with pointers 2022-08-03 13:02:17 -07:00
derper cmd/derper: fix data race & server panic in manual cert mode 2022-08-10 15:14:09 -07:00
derpprobe all: use any instead of interface{} 2022-03-17 11:35:09 -07:00
gitops-pusher cmd/gitops-pusher: things i forgot to push last PR (#5128) 2022-07-25 09:09:32 -04:00
hello net/netaddr: start migrating to net/netip via new netaddr adapter package 2022-07-25 16:20:43 -07:00
mkpkg cmd/mkpkg: use package flag (#4373) 2022-04-07 16:38:33 -04:00
nginx-auth cmd/nginx-auth: maintainer scripts and tailnet checking (#4460) 2022-04-20 13:06:05 -04:00
printdep Docker: add ALPINE.txt to manage alpine versions 2022-06-29 11:47:09 -07:00
proxy-to-grafana all: gofmt for Go 1.19 2022-08-02 10:08:05 -07:00
speedtest cmd: upgrade to ffcli v3 2021-09-14 13:21:55 -07:00
tailscale hostinfo, net/netcheck: use CutPrefix 2022-08-05 15:17:44 -07:00
tailscaled util/deephash: use sha256x (#5339) 2022-08-11 17:44:09 -07:00
testcontrol all: use any instead of interface{} 2022-03-17 11:35:09 -07:00
tsconnect tsconnect: pass in authkey in dev mode (#5320) 2022-08-09 13:07:01 -07:00
tsshd cmd/tsshd: add a package line to appease gofmt 2022-07-25 20:52:04 -07:00
viewer cmd/{cloner,viewer}: add support for map values with pointers 2022-08-03 13:02:17 -07:00