Commit Graph

1889 Commits

Author SHA1 Message Date
Takeshi Yoneda
51aba3703d example: fixes deallocate error in Rust (#2327)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-10-02 10:36:21 -07:00
Nuno Cruces
178eefe8b0 sysfs: disallow absolute symlinks (#2324)
Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
2024-09-27 07:46:07 -07:00
Edward McFarlane
111c51a1bd Fix descriptor.Table buffer growth calc (#2311)
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-09-25 07:31:30 -07:00
Nuno Cruces
dc058c074d sysfs: reopening file doesn't update fd (#2319)
Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
2024-09-24 08:41:46 +09:00
Nuno Cruces
1353ca24fe experimental: allow custom memory allocator Reallocate to fail (#2315)
Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
2024-09-16 10:28:30 +01:00
Edoardo Vacchi
b468adaf3d compiler: ResolveImportedFunction should infer the typeID from the importing module (#2314)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-09-16 10:59:41 +09:00
Edward McFarlane
58488880a3 Show close for concurrent-instantiation example (#2309)
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
2024-09-05 16:22:56 -07:00
Takeshi Yoneda
dbc4b62466 ci: Updates TinyGo to 0.33 (#2304)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-08-20 08:55:34 -07:00
Nuno Cruces
5ed4c174cc ci: upgrade to Go 1.23 (#2301)
Some checks failed
Release CLI / Pre-release build (push) Has been cancelled
Release CLI / Pre-release test (macos-14) (push) Has been cancelled
Release CLI / Pre-release test (ubuntu-22.04) (push) Has been cancelled
Release CLI / Pre-release test (windows-2022) (push) Has been cancelled
Release CLI / Release (push) Has been cancelled
v1.8.0
2024-08-14 06:41:47 -07:00
Bjørn Erik Pedersen
2b12e189ee Improves ImportResolver example (#2299)
Signed-off-by: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
2024-08-05 10:03:31 -07:00
Bjørn Erik Pedersen
a186448de5 Add experimental ImportResolver (#2298)
Closes #2294

Signed-off-by: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
2024-08-05 07:56:24 -07:00
Takeshi Yoneda
5ad3f0631d doc: adds comments on simultaneous compilation (#2295)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-08-01 07:35:17 -07:00
Tyler Rockwood
22b92a5556 Update Benthos to Redpanda Connect (#2291)
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
2024-07-25 12:07:13 -07:00
jerbob92
c345ddf2b5 Add support for Emscripten version 3.1.57 (#2290)
This update the imports/emscripten package implementation
so that it can support v3.1.57+ which came with a breaking
change: https://github.com/emscripten-core/emscripten/pull/21555

Signed-off-by: Jeroen Bobbeldijk <jeroen@klippa.com>
2024-07-19 08:17:29 -07:00
Takeshi Yoneda
c077eabacd ci: tests with Go 1.23rc2 (#2277) 2024-07-17 22:18:10 -07:00
Takeshi Yoneda
9a19a04962 backend: stop allocating ValueDefinitions (#2288)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-07-10 10:41:22 -07:00
Takeshi Yoneda
e2db5acda7 backend: removes unnecessary ValueDefinition fields (#2287)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-07-10 09:51:09 -07:00
Takeshi Yoneda
2c53c6b5a3 ssa: removes valueIDToInstruction slice (#2286)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-07-09 17:35:23 -07:00
Takeshi Yoneda
95f37cd19f ssa: removes map use for Value aliasing (#2285)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-07-09 16:54:24 -07:00
Takeshi Yoneda
0194765782 ssa: stores types in higher 4-bits of Variable (#2284)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-07-09 09:19:13 -07:00
Takeshi Yoneda
6d8e131b65 ssa: removes unnecessary definition (#2283)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-07-09 08:57:56 -07:00
Takeshi Yoneda
e73ede5f55 Uses unsafe.String where possible (#2282)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-07-09 08:00:31 -07:00
Takeshi Yoneda
d520d9c41b test: correctly makes all example tests runnable (#2281)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-07-06 08:45:28 -07:00
Anuraag (Rag) Agrawal
1734cdb9d5 threads: lock around invocations of memory.Grow (#2279)
fixes #2278

Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
2024-07-03 19:29:56 -07:00
Takeshi Yoneda
26d3aeb1b1 doc: adds comments on anonymous module names (#2275)
Anonymous modules are introduced like a few years ago
to allow multiple/concurrent instantiations from a single
binary. That was not documented enough well, so this
adds doc comments in the API.

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-28 07:47:43 -07:00
Takeshi Yoneda
77222b739c ci: merges spectests into normal make test (#2273)
Previously, only specification tests are run separately
from the rest of the tests just to run in a separate
GHA workflow (named spectest) to have a badge to brag.
This used to unnecessarily use CI resources, and no need to
do so anymore.

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-27 15:41:05 -07:00
Takeshi Yoneda
f9373112f4 interpreter: removes unneeded stack walks (#2274)
This makes the interpreter's compilation faster by removing the 
unnecessary stack walks. As a result, for some binary, we observe
93% drops in the compilation performance(!) with an additional 
but negligible memory usage.

```
goos: darwin
goarch: arm64
pkg: github.com/tetratelabs/wazero
                      │   old.txt    │              new.txt               │
                      │    sec/op    │   sec/op     vs base               │
Compilation/wazero-10    130.1m ± 1%   124.7m ± 1%   -4.12% (p=0.002 n=6)
Compilation/zig-10      9097.2m ± 0%   549.0m ± 1%  -93.96% (p=0.002 n=6)
Compilation/zz-10         1.159 ± 5%    1.145 ± 3%   -1.20% (p=0.041 n=6)
TinyGo/Compile/container_heap.test-10     16.54m ± 1%   15.60m ± 4%  -5.66% (p=0.002 n=6)
TinyGo/Compile/container_list.test-10     16.36m ± 1%   15.42m ± 1%  -5.74% (p=0.002 n=6)
TinyGo/Compile/container_ring.test-10     16.08m ± 1%   15.17m ± 0%  -5.64% (p=0.002 n=6)
TinyGo/Compile/crypto_des.test-10         16.79m ± 1%   15.84m ± 0%  -5.68% (p=0.002 n=6)
TinyGo/Compile/crypto_md5.test-10         16.61m ± 1%   15.63m ± 0%  -5.88% (p=0.002 n=6)
TinyGo/Compile/crypto_rc4.test-10         15.93m ± 0%   15.05m ± 1%  -5.54% (p=0.002 n=6)
TinyGo/Compile/crypto_sha1.test-10        16.63m ± 0%   15.69m ± 0%  -5.66% (p=0.002 n=6)
TinyGo/Compile/crypto_sha256.test-10      17.15m ± 1%   16.13m ± 1%  -6.00% (p=0.002 n=6)
TinyGo/Compile/crypto_sha512.test-10      17.43m ± 2%   16.30m ± 1%  -6.49% (p=0.002 n=6)
TinyGo/Compile/encoding_ascii85.test-10   16.57m ± 1%   15.66m ± 1%  -5.52% (p=0.002 n=6)
```

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-27 09:43:47 -07:00
Takeshi Yoneda
6eb6894b9f ci: cleanup vs directory (#2272)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-26 14:27:02 -07:00
Takeshi Yoneda
c4516ae243 Removes integration_test/vs (#2270)
vs was introduced to bench various things including
the tests against other runtimes. However, the
cases are not representative, and also some are
just unable to build plus some are simply failing.

This removes the entire vs directory, and reduces
the maintenance burden.

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-26 10:44:51 -07:00
Takeshi Yoneda
d425b9eedc regalloc: complete de-virtualization (#2269) 2024-06-25 11:37:49 -07:00
Takeshi Yoneda
200980ef11 regalloc: removes unused Instr.AddedBeforeRegAlloc api (#2268)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-25 10:14:12 -07:00
Takeshi Yoneda
8db4d0fbc1 regalloc: simplifies findOrSpillAllocatable (#2267)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-25 09:59:23 -07:00
Takeshi Yoneda
c3c3c5f87a compiler: removes unnecessary code paths (#2266)
This removes the unnecessary code paths in a various places,
and the below is the result:

```
goos: darwin
goarch: arm64
pkg: github.com/tetratelabs/wazero
                      │  old.txt   │             new.txt              │
                      │   sec/op   │   sec/op    vs base              │
Compilation/wazero-10   1.634 ± 0%   1.626 ± 0%  -0.51% (p=0.002 n=6)
Compilation/zig-10      3.588 ± 0%   3.538 ± 2%       ~ (p=0.065 n=6)
Compilation/zz-10       15.25 ± 0%   14.87 ± 1%  -2.46% (p=0.002 n=6)
geomean                 4.472        4.406       -1.46%

                      │   old.txt    │              new.txt               │
                      │     B/op     │     B/op      vs base              │
Compilation/wazero-10   271.2Mi ± 0%   271.2Mi ± 0%       ~ (p=1.000 n=6)
Compilation/zig-10      596.3Mi ± 0%   596.3Mi ± 0%       ~ (p=0.699 n=6)
Compilation/zz-10       528.9Mi ± 0%   528.9Mi ± 0%       ~ (p=0.818 n=6)
geomean                 440.6Mi        440.6Mi       +0.00%

                      │   old.txt   │              new.txt              │
                      │  allocs/op  │  allocs/op   vs base              │
Compilation/wazero-10   448.5k ± 0%   448.5k ± 0%       ~ (p=0.937 n=6)
Compilation/zig-10      274.8k ± 0%   274.7k ± 0%       ~ (p=1.000 n=6)
Compilation/zz-10       618.3k ± 0%   618.4k ± 0%       ~ (p=0.818 n=6)
geomean                 423.9k        423.9k       -0.00%
```


Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-25 09:20:15 -07:00
Takeshi Yoneda
c0576bccff backend: de-virtualize regalloc (#2265)
This de-virtualize the regalloc code, and we got the overall 5% 
compilation perf improvements without runtime impact.

```
goos: darwin
goarch: arm64
pkg: github.com/tetratelabs/wazero
                      │  old.txt   │             new.txt              │
                      │   sec/op   │   sec/op    vs base              │
Compilation/wazero-10   1.722 ± 2%   1.636 ± 1%  -4.95% (p=0.002 n=6)
Compilation/zig-10      3.761 ± 0%   3.589 ± 0%  -4.58% (p=0.002 n=6)
Compilation/zz-10       16.03 ± 0%   15.20 ± 1%  -5.15% (p=0.002 n=6)
geomean                 4.700        4.470       -4.90%

                      │   old.txt    │              new.txt               │
                      │     B/op     │     B/op      vs base              │
Compilation/wazero-10   286.8Mi ± 0%   271.2Mi ± 0%  -5.44% (p=0.002 n=6)
Compilation/zig-10      601.7Mi ± 0%   596.2Mi ± 0%  -0.90% (p=0.002 n=6)
Compilation/zz-10       538.1Mi ± 0%   528.9Mi ± 0%  -1.72% (p=0.002 n=6)
geomean                 452.8Mi        440.6Mi       -2.71%

                      │   old.txt   │              new.txt              │
                      │  allocs/op  │  allocs/op   vs base              │
Compilation/wazero-10   448.4k ± 0%   448.4k ± 0%       ~ (p=0.699 n=6)
Compilation/zig-10      274.6k ± 0%   274.6k ± 0%       ~ (p=0.974 n=6)
Compilation/zz-10       618.3k ± 0%   618.5k ± 0%       ~ (p=0.065 n=6)
geomean                 423.8k        423.9k       +0.02%
```

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-25 08:49:07 -07:00
Takeshi Yoneda
78f2e9395e ssa: simplifies initializeCurrentBlockKnownBounds (#2263)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-23 13:43:45 -07:00
Takeshi Yoneda
98d6b90da2 regalloc: use less memory in liveness analysis (#2262)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-21 15:05:19 -07:00
Takeshi Yoneda
d18cca6382 regalloc: fast access to vrState (#2261)
This refactors the regalloc code and makes the access to
vrState pointers really fast and reduce the unnecessary 
function calls that cannot be inlined. As a result, overall
compilation perfomance improves +10% with a slight cost
of memory usage without any impact on the runtime performance.

```
goos: darwin
goarch: arm64
pkg: github.com/tetratelabs/wazero/internal/integration_test/stdlibs
                                                   │    old.txt    │              new.txt               │
                                                   │    sec/op     │   sec/op     vs base               │
Zig/Compile/test-opt.wasm-10                           3.280 ±  1%    2.976 ± 1%   -9.25% (p=0.001 n=7)
Zig/Compile/test.wasm-10                               4.078 ±  1%    3.771 ± 2%   -7.51% (p=0.001 n=7)
TinyGo/Compile/container_heap.test-10                 299.6m ±  2%   266.1m ± 1%  -11.18% (p=0.001 n=7)
TinyGo/Compile/container_list.test-10                 297.9m ±  0%   264.9m ± 0%  -11.07% (p=0.001 n=7)
TinyGo/Compile/container_ring.test-10                 292.4m ±  0%   260.8m ± 2%  -10.82% (p=0.001 n=7)
TinyGo/Compile/crypto_des.test-10                     304.9m ±  1%   270.8m ± 3%  -11.17% (p=0.001 n=7)
TinyGo/Compile/crypto_md5.test-10                     302.8m ±  0%   269.4m ± 1%  -11.02% (p=0.001 n=7)
TinyGo/Compile/crypto_rc4.test-10                     291.7m ±  0%   259.1m ± 1%  -11.18% (p=0.001 n=7)
TinyGo/Compile/crypto_sha1.test-10                    302.9m ±  2%   269.5m ± 0%  -11.04% (p=0.001 n=7)
TinyGo/Compile/crypto_sha256.test-10                  308.3m ±  1%   274.5m ± 1%  -10.97% (p=0.001 n=7)
TinyGo/Compile/crypto_sha512.test-10                  309.9m ±  0%   276.0m ± 0%  -10.95% (p=0.001 n=7)
TinyGo/Compile/encoding_ascii85.test-10               302.2m ±  1%   269.1m ± 0%  -10.94% (p=0.001 n=7)
TinyGo/Compile/encoding_base32.test-10                641.2m ±  0%   594.4m ± 0%   -7.29% (p=0.001 n=7)
TinyGo/Compile/encoding_csv.test-10                   325.8m ±  0%   289.4m ± 0%  -11.17% (p=0.001 n=7)
TinyGo/Compile/encoding_hex.test-10                   313.8m ±  1%   279.2m ± 0%  -11.05% (p=0.001 n=7)
TinyGo/Compile/go_scanner.test-10                     336.1m ±  4%   298.5m ± 0%  -11.20% (p=0.001 n=7)
TinyGo/Compile/hash.test-10                           402.6m ±  0%   363.3m ± 0%   -9.78% (p=0.001 n=7)
TinyGo/Compile/hash_adler32.test-10                   291.4m ±  2%   259.3m ± 1%  -11.00% (p=0.001 n=7)
TinyGo/Compile/hash_crc64.test-10                     378.3m ±  0%   342.2m ± 0%   -9.52% (p=0.001 n=7)
TinyGo/Compile/hash_fnv.test-10                       306.0m ±  1%   271.7m ± 1%  -11.20% (p=0.001 n=7)
TinyGo/Compile/html.test-10                            2.018 ±  1%    1.971 ± 2%   -2.32% (p=0.001 n=7)
TinyGo/Compile/internal_itoa.test-10                  288.5m ± 10%   257.8m ± 1%  -10.66% (p=0.001 n=7)
TinyGo/Compile/internal_profile.test-10               409.4m ±  1%   364.0m ± 1%  -11.08% (p=0.001 n=7)
TinyGo/Compile/math.test-10                           388.6m ±  0%   345.4m ± 1%  -11.10% (p=0.001 n=7)
TinyGo/Compile/math_cmplx.test-10                     330.9m ±  0%   294.2m ± 0%  -11.08% (p=0.001 n=7)
TinyGo/Compile/net.test-10                            343.9m ±  1%   306.5m ± 1%  -10.86% (p=0.001 n=7)
TinyGo/Compile/net_http_internal_ascii.test-10        288.2m ±  0%   256.9m ± 1%  -10.85% (p=0.001 n=7)
TinyGo/Compile/net_mail.test-10                       386.6m ±  1%   344.2m ± 0%  -10.97% (p=0.001 n=7)
TinyGo/Compile/os.test-10                             362.2m ±  0%   321.3m ± 0%  -11.31% (p=0.001 n=7)
TinyGo/Compile/path.test-10                           297.7m ±  0%   265.7m ± 0%  -10.72% (p=0.001 n=7)
TinyGo/Compile/reflect.test-10                        406.3m ±  1%   360.4m ± 1%  -11.30% (p=0.001 n=7)
TinyGo/Compile/sync.test-10                           302.8m ±  0%   269.9m ± 1%  -10.89% (p=0.001 n=7)
TinyGo/Compile/testing.test-10                        331.0m ±  3%   293.5m ± 0%  -11.31% (p=0.001 n=7)
TinyGo/Compile/testing_iotest.test-10                 315.1m ±  0%   281.5m ± 1%  -10.66% (p=0.001 n=7)
TinyGo/Compile/text_scanner.test-10                   322.0m ±  0%   286.7m ± 0%  -10.97% (p=0.001 n=7)
TinyGo/Compile/unicode.test-10                        304.7m ±  0%   271.6m ± 0%  -10.86% (p=0.001 n=7)
TinyGo/Compile/unicode_utf16.test-10                  303.9m ±  0%   271.2m ± 2%  -10.75% (p=0.001 n=7)
TinyGo/Compile/unicode_utf8.test-10                   300.8m ±  1%   268.2m ± 0%  -10.86% (p=0.001 n=7)
Wasip1/Compile/src_archive_tar.test-10                 1.869 ±  1%    1.643 ± 0%  -12.08% (p=0.001 n=7)
Wasip1/Compile/src_bufio.test-10                       1.268 ±  4%    1.115 ± 1%  -12.04% (p=0.001 n=7)
Wasip1/Compile/src_bytes.test-10                       1.307 ±  1%    1.152 ± 0%  -11.85% (p=0.001 n=7)
Wasip1/Compile/src_context.test-10                     1.407 ±  0%    1.243 ± 1%  -11.66% (p=0.001 n=7)
Wasip1/Compile/src_encoding_ascii85.test-10            1.136 ±  1%    1.002 ± 1%  -11.81% (p=0.001 n=7)
Wasip1/Compile/src_encoding_asn1.test-10               1.301 ±  0%    1.148 ± 1%  -11.80% (p=0.001 n=7)
Wasip1/Compile/src_encoding_base32.test-10             1.180 ±  1%    1.041 ± 1%  -11.80% (p=0.001 n=7)
Wasip1/Compile/src_encoding_base64.test-10             1.186 ±  0%    1.046 ± 0%  -11.76% (p=0.001 n=7)
Wasip1/Compile/src_encoding_binary.test-10             1.216 ±  0%    1.072 ± 1%  -11.88% (p=0.001 n=7)
Wasip1/Compile/src_encoding_csv.test-10                1.182 ±  0%    1.042 ± 0%  -11.81% (p=0.001 n=7)
Wasip1/Compile/src_encoding_gob.test-10                1.612 ±  0%    1.424 ± 4%  -11.69% (p=0.001 n=7)
Wasip1/Compile/src_encoding_hex.test-10                1.153 ±  0%    1.018 ± 1%  -11.70% (p=0.001 n=7)
Wasip1/Compile/src_encoding_json.test-10               3.412 ±  1%    3.013 ± 0%  -11.69% (p=0.001 n=7)
Wasip1/Compile/src_encoding_pem.test-10                1.494 ±  0%    1.319 ± 1%  -11.68% (p=0.001 n=7)
Wasip1/Compile/src_encoding_xml.test-10                1.400 ±  0%    1.236 ± 2%  -11.76% (p=0.001 n=7)
Wasip1/Compile/src_errors.test-10                      1.178 ±  0%    1.038 ± 0%  -11.83% (p=0.001 n=7)
Wasip1/Compile/src_expvar.test-10                      1.751 ±  0%    1.543 ± 0%  -11.87% (p=0.001 n=7)
Wasip1/Compile/src_flag.test-10                        1.279 ±  0%    1.127 ± 0%  -11.89% (p=0.001 n=7)
Wasip1/Compile/src_fmt.test-10                         1.291 ±  0%    1.143 ± 1%  -11.50% (p=0.001 n=7)
Wasip1/Compile/src_hash.test-10                        1.160 ±  0%    1.022 ± 0%  -11.83% (p=0.001 n=7)
Wasip1/Compile/src_hash_adler32.test-10              1170.5m ±  4%   996.2m ± 2%  -14.88% (p=0.001 n=7)
Wasip1/Compile/src_hash_crc32.test-10                  1.188 ±  0%    1.008 ± 0%  -15.17% (p=0.001 n=7)
Wasip1/Compile/src_hash_crc64.test-10                  1.136 ±  4%    1.000 ± 0%  -12.00% (p=0.001 n=7)
Wasip1/Compile/src_hash_fnv.test-10                    1.141 ±  0%    1.002 ± 0%  -12.18% (p=0.001 n=7)
Wasip1/Compile/src_hash_maphash.test-10                1.151 ±  0%    1.010 ± 0%  -12.25% (p=0.001 n=7)
Wasip1/Compile/src_io.test-10                          1.264 ±  0%    1.110 ± 0%  -12.20% (p=0.001 n=7)
Wasip1/Compile/src_io_fs.test-10                       1.248 ±  1%    1.101 ± 0%  -11.75% (p=0.001 n=7)
Wasip1/Compile/src_io_ioutil.test-10                   1.166 ±  0%    1.028 ± 1%  -11.86% (p=0.001 n=7)
Wasip1/Compile/src_log.test-10                         1.145 ±  0%    1.009 ± 0%  -11.95% (p=0.001 n=7)
Wasip1/Compile/src_log_syslog.test-10                  1.133 ±  0%    1.001 ± 0%  -11.66% (p=0.001 n=7)
Wasip1/Compile/src_maps.test-10                        1.144 ±  0%    1.010 ± 0%  -11.77% (p=0.001 n=7)
Wasip1/Compile/src_math.test-10                        1.248 ±  0%    1.102 ± 0%  -11.68% (p=0.001 n=7)
Wasip1/Compile/src_math_big.test-10                    2.368 ±  1%    2.082 ± 0%  -12.07% (p=0.001 n=7)
Wasip1/Compile/src_math_bits.test-10                   1.158 ±  0%    1.022 ± 0%  -11.71% (p=0.001 n=7)
Wasip1/Compile/src_math_cmplx.test-10                  1.176 ±  0%    1.035 ± 0%  -12.00% (p=0.001 n=7)
Wasip1/Compile/src_math_rand.test-10                   1.871 ±  1%    1.649 ± 2%  -11.88% (p=0.001 n=7)
Wasip1/Compile/src_mime.test-10                        1.237 ±  0%    1.089 ± 0%  -11.99% (p=0.001 n=7)
Wasip1/Compile/src_mime_multipart.test-10              1.412 ±  0%    1.239 ± 0%  -12.26% (p=0.001 n=7)
Wasip1/Compile/src_mime_quotedprintable.test-10        1.192 ±  0%    1.049 ± 0%  -11.96% (p=0.001 n=7)
Wasip1/Compile/src_os.test-10                          1.598 ±  0%    1.409 ± 0%  -11.82% (p=0.001 n=7)
Wasip1/Compile/src_os_exec.test-10                     3.080 ±  0%    2.706 ± 5%  -12.15% (p=0.001 n=7)
Wasip1/Compile/src_os_signal.test-10                 1121.0m ±  0%   987.4m ± 0%  -11.92% (p=0.001 n=7)
Wasip1/Compile/src_os_user.test-10                     1.151 ±  0%    1.014 ± 1%  -11.86% (p=0.001 n=7)
Wasip1/Compile/src_path.test-10                        1.138 ±  0%    1.002 ± 0%  -11.89% (p=0.001 n=7)
Wasip1/Compile/src_reflect.test-10                     2.507 ±  0%    2.215 ± 0%  -11.67% (p=0.001 n=7)
Wasip1/Compile/src_regexp.test-10                      1.348 ±  0%    1.185 ± 0%  -12.09% (p=0.001 n=7)
Wasip1/Compile/src_regexp_syntax.test-10               1.156 ±  0%    1.017 ± 0%  -12.04% (p=0.001 n=7)
Wasip1/Compile/src_runtime.test-10                     4.018 ±  0%    3.543 ± 1%  -11.83% (p=0.001 n=7)
Wasip1/Compile/src_runtime_internal_atomic.test-10     1.143 ±  0%    1.007 ± 1%  -11.86% (p=0.001 n=7)
Wasip1/Compile/src_runtime_internal_math.test-10     1120.5m ±  0%   987.9m ± 4%  -11.84% (p=0.001 n=7)
Wasip1/Compile/src_runtime_internal_sys.test-10      1120.5m ±  1%   986.7m ± 0%  -11.94% (p=0.001 n=7)
Wasip1/Compile/src_slices.test-10                      1.278 ±  0%    1.122 ± 0%  -12.19% (p=0.001 n=7)
Wasip1/Compile/src_sort.test-10                        1.201 ±  0%    1.057 ± 0%  -11.99% (p=0.001 n=7)
Wasip1/Compile/src_strconv.test-10                     1.270 ±  1%    1.118 ± 0%  -11.95% (p=0.001 n=7)
Wasip1/Compile/src_strings.test-10                     1.309 ±  0%    1.150 ± 0%  -12.11% (p=0.001 n=7)
Wasip1/Compile/src_sync.test-10                        1.302 ±  0%    1.148 ± 1%  -11.84% (p=0.001 n=7)
Wasip1/Compile/src_sync_atomic.test-10                 1.212 ±  1%    1.069 ± 0%  -11.83% (p=0.001 n=7)
Wasip1/Compile/src_syscall.test-10                   1127.6m ±  0%   997.3m ± 6%  -11.55% (p=0.001 n=7)
Wasip1/Compile/src_testing.test-10                     1.707 ±  0%    1.506 ± 0%  -11.78% (p=0.001 n=7)
Wasip1/Compile/src_testing_fstest.test-10              1.278 ±  0%    1.129 ± 0%  -11.65% (p=0.001 n=7)
Wasip1/Compile/src_testing_iotest.test-10              1.168 ±  1%    1.029 ± 0%  -11.85% (p=0.001 n=7)
Wasip1/Compile/src_testing_quick.test-10               1.183 ±  2%    1.041 ± 0%  -11.94% (p=0.001 n=7)
Wasip1/Compile/src_time.test-10                        1.990 ±  2%    1.756 ± 0%  -11.80% (p=0.001 n=7)
geomean                                               852.1m         754.8m       -11.42%
```


Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-21 12:18:32 -07:00
Takeshi Yoneda
7929b200f4 amd64: fixes lowerSqmulRoundSat (#2260)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-20 10:21:26 -07:00
Takeshi Yoneda
69c78f9b77 Prevents direct use of host functions via ExportedFunction (#2259)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-20 09:35:22 -07:00
Nuno Cruces
f902fb4d05 Revert tinygo reflect.SliceHeader specialization (#2210)
Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
2024-06-18 13:01:46 -07:00
Takeshi Yoneda
c6ffc9edd1 regalloc: eliminates unnecessary Instr loop (#2258)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-18 11:31:57 -07:00
Takeshi Yoneda
54cee893da regalloc: simplifies livenessAnalysis/finalizeStartReg (#2256)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-17 15:23:39 -07:00
Takeshi Yoneda
c96893d691 frontend: reuses br_table tmp slice correctly (#2253)
Previously, the `tmpForBrTable` slice hadn't been
correctly reused, and this fixes it.
As a result, for br_table heavy cases, we see the huge
drop in the number of allocations:

```
goos: darwin
goarch: arm64
pkg: github.com/tetratelabs/wazero
                      │  old.txt   │             new.txt              │
                      │   sec/op   │   sec/op    vs base              │
Compilation/wazero-10   1.995 ± 0%   1.999 ± 1%       ~ (p=0.394 n=6)
Compilation/zig-10      4.169 ± 0%   4.168 ± 1%       ~ (p=0.589 n=6)
Compilation/zz-10       18.55 ± 0%   18.55 ± 0%       ~ (p=0.818 n=6)
geomean                 5.363        5.367       +0.06%

                      │   old.txt    │              new.txt               │
                      │     B/op     │     B/op      vs base              │
Compilation/wazero-10   286.8Mi ± 0%   285.4Mi ± 0%  -0.46% (p=0.002 n=6)
Compilation/zig-10      590.3Mi ± 0%   590.1Mi ± 0%  -0.03% (p=0.002 n=6)
Compilation/zz-10       549.4Mi ± 0%   537.7Mi ± 0%  -2.12% (p=0.002 n=6)
geomean                 453.0Mi        449.1Mi       -0.88%

                      │   old.txt   │              new.txt               │
                      │  allocs/op  │  allocs/op   vs base               │
Compilation/wazero-10   445.3k ± 0%   429.0k ± 0%   -3.66% (p=0.002 n=6)
Compilation/zig-10      273.0k ± 0%   269.6k ± 0%   -1.26% (p=0.002 n=6)
Compilation/zz-10       783.3k ± 0%   605.8k ± 0%  -22.66% (p=0.002 n=6)
geomean                 456.7k        412.2k        -9.73%
```

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-14 11:25:29 -07:00
Takeshi Yoneda
6d3a77e89a validation: avoids allocation per br_table (#2252)
This eliminates the allocation that previously happened
per br_table instruction during function validation.

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-14 11:11:00 -07:00
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
Takeshi Yoneda
ec36887ad2 ssa: removes redundantParameterIndexToValue map (#2250)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-14 08:52:40 -07:00
Takeshi Yoneda
bf42c25657 ci: removes amd64/macOS tests (#2248)
This removes amd64/macOS test environments.
Each dimension is tested separately even after this,
so this saves the CI resources.

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-13 15:02:35 -07:00
Takeshi Yoneda
65650d399d ssa: reuses slices for basicBlock.params (#2247)
This replaces the basicBlock.params field with the reusable
VarLength[Value] type. As a result, the compilation starts
using less memory and allocations.

```
goos: darwin
goarch: arm64
pkg: github.com/tetratelabs/wazero
                      │  old.txt   │             new.txt              │
                      │   sec/op   │   sec/op    vs base              │
Compilation/wazero-10   2.004 ± 2%   2.001 ± 0%       ~ (p=0.620 n=7)
Compilation/zig-10      4.164 ± 1%   4.174 ± 3%       ~ (p=0.097 n=7)
geomean                 2.888        2.890       +0.06%

                      │   old.txt    │              new.txt               │
                      │     B/op     │     B/op      vs base              │
Compilation/wazero-10   297.7Mi ± 0%   297.5Mi ± 0%  -0.06% (p=0.001 n=7)
Compilation/zig-10      594.0Mi ± 0%   593.9Mi ± 0%  -0.01% (p=0.001 n=7)
geomean                 420.5Mi        420.3Mi       -0.03%

                      │   old.txt   │              new.txt              │
                      │  allocs/op  │  allocs/op   vs base              │
Compilation/wazero-10   472.5k ± 0%   457.1k ± 0%  -3.25% (p=0.001 n=7)
Compilation/zig-10      277.2k ± 0%   275.7k ± 0%  -0.53% (p=0.001 n=7)
geomean                 361.9k        355.0k       -1.90%
```

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-13 13:01:58 -07:00
Takeshi Yoneda
37fea1236c Removes dead codes (#2246)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-06-12 09:35:41 -07:00
Yage Hu
8b3af37da0 wasi: path_open should accept a dir with RIGHT_FD_WRITE (#2244)
Some checks failed
Release CLI / Pre-release build (push) Has been cancelled
Release CLI / Pre-release test (macos-12) (push) Has been cancelled
Release CLI / Pre-release test (ubuntu-22.04) (push) Has been cancelled
Release CLI / Pre-release test (windows-2022) (push) Has been cancelled
Release CLI / Release (push) Has been cancelled
Signed-off-by: Yage Hu <me@huyage.dev>
v1.7.3
2024-06-11 18:02:47 +02:00