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.
garble/testdata/script
Daniel Martí 41df1f8725 slightly reduce the range of hashed name lengths
v0.8.0 was improved to obfuscate names so that they didn't all end up
with the same length. We went from a length fixed to 8 to a range
between 8 and 15.

Since the new mechanism chooses a length evenly between 8 and 15,
the average hashed name length went from 8 to 11.5.

While this improved obfuscation, it also increased the size of
obfuscated binaries by quite a bit. We do need to use a reasonably large
length to avoid collisions within packages, but we also don't want it to
be large enough to cause too much bloat.

Reduce the minimum and maximum from 8 and 15 to 6 and 12. This means
that the average goes fro 11.5 to 9, much closer to the old average.
We could consider a range of 4 to 12, but 4 bytes is short enough where
collisions become likely in practice, even if it's just the minimum.
And a range of 6 to 10 shrinks the range a bit too much.

	name      old time/op         new time/op         delta
	Build-16          20.6s ± 0%          20.6s ± 0%    ~     (p=0.421 n=5+5)

	name      old bin-B           new bin-B           delta
	Build-16          5.77M ± 0%          5.66M ± 0%  -1.92%  (p=0.008 n=5+5)

	name      old cached-time/op  new cached-time/op  delta
	Build-16          705ms ± 4%          703ms ± 2%    ~     (p=0.690 n=5+5)

	name      old mallocs/op      new mallocs/op      delta
	Build-16          25.0M ± 0%          25.0M ± 0%  -0.08%  (p=0.008 n=5+5)

	name      old sys-time/op     new sys-time/op     delta
	Build-16          8.11s ± 2%          8.11s ± 2%    ~     (p=0.841 n=5+5)

Updates #618.
2 years ago
..
asm.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
basic.txtar drop support for Go 1.18.x 3 years ago
cgo.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
crossbuild.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
debugdir.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
embed.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
goenv.txtar drop support for Go 1.18.x 3 years ago
gogarble.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
goversion.txtar drop support for Go 1.18.x 3 years ago
help.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
implement.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
imports.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
init.txtar drop support for Go 1.18.x 3 years ago
ldflags.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
linkname.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
literals.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
modinfo.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
plugin.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
position.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
reflect.txtar avoid reflect method call panics with GOGARBLE=* 2 years ago
reverse.txtar CI: bump gotip to December 2022 2 years ago
seed-cache.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
seed.txtar slightly reduce the range of hashed name lengths 2 years ago
syntax.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
test.txtar support `garble test` in main packages 2 years ago
tiny.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
typeparams.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago