Takeshi Yoneda
b9571dfbab
compiler: memory usage optimization around br_table (#2251)
This optimizes the memory usage during compilation for
br_table instructions. As you can see in the bench results below,
for some cases where lots of br_tables exists (the case named `zz`),
the compilation uses 10% less allocations and 5% less memory, hence
the slightly faster compilation.
```
goos: darwin
goarch: arm64
pkg: github.com/tetratelabs/wazero
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
Compilation/wazero-10 2.015 ± 2% 1.993 ± 0% -1.09% (p=0.002 n=6)
Compilation/zig-10 4.200 ± 0% 4.161 ± 1% -0.93% (p=0.004 n=6)
Compilation/zz-10 18.70 ± 0% 18.57 ± 0% -0.69% (p=0.002 n=6)
geomean 5.409 5.360 -0.90%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
Compilation/wazero-10 297.5Mi ± 0% 287.1Mi ± 0% -3.48% (p=0.002 n=6)
Compilation/zig-10 593.9Mi ± 0% 590.3Mi ± 0% -0.61% (p=0.002 n=6)
Compilation/zz-10 582.6Mi ± 0% 553.7Mi ± 0% -4.96% (p=0.002 n=6)
geomean 468.7Mi 454.4Mi -3.03%
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
Compilation/wazero-10 457.0k ± 0% 449.1k ± 0% -1.72% (p=0.002 n=6)
Compilation/zig-10 275.8k ± 0% 273.8k ± 0% -0.70% (p=0.002 n=6)
Compilation/zz-10 926.5k ± 0% 830.9k ± 0% -10.32% (p=0.002 n=6)
geomean 488.7k 467.5k -4.35%
```
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-14 10:47:07 -07:00
..
2023-03-13 11:41:19 +08:00
2023-04-21 16:08:35 +02:00
2023-08-20 08:10:10 +09:00
2024-06-14 10:47:07 -07:00
2024-04-15 14:55:14 +09:00
2024-02-24 07:00:57 +09:00
2023-08-07 15:50:38 +08:00
2024-04-22 11:17:10 +09:00
2022-11-03 10:23:35 +08:00
2024-06-01 12:45:45 -07:00
2023-04-28 15:32:32 +08:00
2023-02-09 07:38:22 -10:00
2024-04-06 21:04:55 +09:00
2022-10-24 11:51:48 +09:00
2024-06-12 09:35:41 -07:00
2024-03-31 11:11:31 +02:00
2024-04-22 11:17:10 +09:00
2024-06-11 18:02:47 +02:00
2024-04-06 21:04:55 +09:00
2022-06-22 13:31:26 +09:00
2022-04-14 10:05:38 +08:00
2024-02-09 13:29:57 -08:00
2024-04-22 11:17:10 +09:00
2024-06-07 12:50:25 -07:00
2024-04-30 17:23:46 +09:00
2024-01-15 08:20:40 -08:00