Commit 53ad68d
committed
cmd/compile: allow unaligned load/store on Wasm
Wasm supports unaligned load/store instructions. Use them.
This speeds up map hashing slightly (among others):
goos: js
goarch: wasm
pkg: runtime
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
Hash5 14.06n ± 2% 13.83n ± 5% ~ (p=0.186 n=10)
Hash16 17.52n ± 1% 17.04n ± 1% -2.71% (p=0.000 n=10)
Hash64 28.68n ± 1% 26.61n ± 1% -7.18% (p=0.000 n=10)
Hash1024 271.4n ± 0% 243.6n ± 1% -10.21% (p=0.000 n=10)
Hash65536 16.66µ ± 0% 15.74µ ± 1% -5.49% (p=0.000 n=10)
HashStringSpeed 29.23n ± 1% 28.70n ± 1% -1.83% (p=0.000 n=10)
HashBytesSpeed 46.11n ± 4% 45.17n ± 5% -2.04% (p=0.008 n=10)
HashInt32Speed 20.39n ± 1% 20.24n ± 5% ~ (p=0.239 n=10)
HashInt64Speed 20.81n ± 7% 20.58n ± 7% ~ (p=0.238 n=10)
HashStringArraySpeed 76.65n ± 2% 73.72n ± 1% -3.83% (p=0.000 n=10)
FastrandHashiter 87.65n ± 1% 87.58n ± 1% ~ (p=0.725 n=10)
geomean 67.03n 64.75n -3.40%
Change-Id: I7fd1817c74323f628f310393b0330a0a51ffa3a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/714720
Reviewed-by: Michael Knyszek <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>1 parent 12ec09f commit 53ad68d
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| |||
0 commit comments