jz 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bench/bench.svg +14 -14
- package/dist/jz.js +897 -804
- package/module/array.js +20 -0
- package/module/math.js +148 -121
- package/module/string.js +133 -15
- package/package.json +2 -2
- package/src/abi/string.js +11 -6
- package/src/compile/emit.js +77 -17
- package/src/compile/index.js +6 -0
- package/src/compile/infer.js +8 -1
- package/src/compile/loop-recurrence.js +167 -0
- package/src/compile/narrow.js +12 -3
- package/src/optimize/index.js +166 -1
- package/src/optimize/vectorize.js +10 -0
- package/src/prepare/index.js +18 -5
package/bench/bench.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 424" width="720" height="424" style="color-scheme:light dark" role="img" aria-label="JZ benchmark — every rival compiled to WebAssembly, run in V8 · native C = reference; geometric mean across
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 424" width="720" height="424" style="color-scheme:light dark" role="img" aria-label="JZ benchmark — every rival compiled to WebAssembly, run in V8 · native C = reference; geometric mean across 39 benchmark cases · lower is faster, JZ = 1.00× baseline; each ball's speed is proportional to that engine's geometric-mean runtime across the corpus">
|
|
2
2
|
|
|
3
3
|
<g font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif">
|
|
4
4
|
<rect x="174" y="43.5" width="476" height="3" rx="1.5" fill="currentColor" fill-opacity="0.1"/>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<text x="156" y="106" text-anchor="end" font-size="10" fill="currentColor" fill-opacity="0.46">clang -O3 · ref</text>
|
|
21
21
|
<text x="662" y="99" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">1.01×</text>
|
|
22
22
|
<circle cx="182.0" cy="95" r="8" fill="currentColor" fill-opacity="0.4">
|
|
23
|
-
<animate attributeName="cx" dur="1.
|
|
23
|
+
<animate attributeName="cx" dur="1.6146835172309477s" repeatCount="indefinite" calcMode="linear"
|
|
24
24
|
keyTimes="0;0.5;1" values="182.0;642.0;182.0" begin="-0.41s"/>
|
|
25
25
|
</circle>
|
|
26
26
|
</g>
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
<line x1="650" y1="138" x2="650" y2="152" stroke="currentColor" stroke-opacity="0.3" stroke-width="2"/>
|
|
31
31
|
<text x="156" y="141" text-anchor="end" font-size="14" font-weight="500" fill="currentColor" fill-opacity="0.82">C</text>
|
|
32
32
|
<text x="156" y="156" text-anchor="end" font-size="10" fill="currentColor" fill-opacity="0.46">clang → wasm</text>
|
|
33
|
-
<text x="662" y="149" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">2.
|
|
33
|
+
<text x="662" y="149" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">2.03×</text>
|
|
34
34
|
<circle cx="182.0" cy="145" r="8" fill="currentColor" fill-opacity="0.4">
|
|
35
|
-
<animate attributeName="cx" dur="3.
|
|
35
|
+
<animate attributeName="cx" dur="3.2426115177636263s" repeatCount="indefinite" calcMode="linear"
|
|
36
36
|
keyTimes="0;0.5;1" values="182.0;642.0;182.0" begin="-0.82s"/>
|
|
37
37
|
</circle>
|
|
38
38
|
</g>
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
<line x1="650" y1="188" x2="650" y2="202" stroke="currentColor" stroke-opacity="0.3" stroke-width="2"/>
|
|
43
43
|
<text x="156" y="191" text-anchor="end" font-size="14" font-weight="500" fill="currentColor" fill-opacity="0.82">Rust</text>
|
|
44
44
|
<text x="156" y="206" text-anchor="end" font-size="10" fill="currentColor" fill-opacity="0.46">rustc → wasm</text>
|
|
45
|
-
<text x="662" y="199" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">2.
|
|
45
|
+
<text x="662" y="199" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">2.06×</text>
|
|
46
46
|
<circle cx="182.0" cy="195" r="8" fill="currentColor" fill-opacity="0.4">
|
|
47
|
-
<animate attributeName="cx" dur="3.
|
|
47
|
+
<animate attributeName="cx" dur="3.293585213146645s" repeatCount="indefinite" calcMode="linear"
|
|
48
48
|
keyTimes="0;0.5;1" values="182.0;642.0;182.0" begin="-1.23s"/>
|
|
49
49
|
</circle>
|
|
50
50
|
</g>
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
<line x1="650" y1="238" x2="650" y2="252" stroke="currentColor" stroke-opacity="0.3" stroke-width="2"/>
|
|
55
55
|
<text x="156" y="241" text-anchor="end" font-size="14" font-weight="500" fill="currentColor" fill-opacity="0.82">AssemblyScript</text>
|
|
56
56
|
<text x="156" y="256" text-anchor="end" font-size="10" fill="currentColor" fill-opacity="0.46">asc -O3</text>
|
|
57
|
-
<text x="662" y="249" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">2.
|
|
57
|
+
<text x="662" y="249" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">2.12×</text>
|
|
58
58
|
<circle cx="182.0" cy="245" r="8" fill="currentColor" fill-opacity="0.4">
|
|
59
|
-
<animate attributeName="cx" dur="3.
|
|
59
|
+
<animate attributeName="cx" dur="3.3917031518823295s" repeatCount="indefinite" calcMode="linear"
|
|
60
60
|
keyTimes="0;0.5;1" values="182.0;642.0;182.0" begin="-1.64s"/>
|
|
61
61
|
</circle>
|
|
62
62
|
</g>
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
<line x1="650" y1="288" x2="650" y2="302" stroke="currentColor" stroke-opacity="0.3" stroke-width="2"/>
|
|
67
67
|
<text x="156" y="291" text-anchor="end" font-size="14" font-weight="500" fill="currentColor" fill-opacity="0.82">V8</text>
|
|
68
68
|
<text x="156" y="306" text-anchor="end" font-size="10" fill="currentColor" fill-opacity="0.46">Node (JS)</text>
|
|
69
|
-
<text x="662" y="299" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">2.
|
|
69
|
+
<text x="662" y="299" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">2.32×</text>
|
|
70
70
|
<circle cx="182.0" cy="295" r="8" fill="currentColor" fill-opacity="0.4">
|
|
71
|
-
<animate attributeName="cx" dur="3.
|
|
71
|
+
<animate attributeName="cx" dur="3.7148470369678392s" repeatCount="indefinite" calcMode="linear"
|
|
72
72
|
keyTimes="0;0.5;1" values="182.0;642.0;182.0" begin="-2.05s"/>
|
|
73
73
|
</circle>
|
|
74
74
|
</g>
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
<line x1="174" y1="338" x2="174" y2="352" stroke="currentColor" stroke-opacity="0.3" stroke-width="2"/>
|
|
78
78
|
<line x1="650" y1="338" x2="650" y2="352" stroke="currentColor" stroke-opacity="0.3" stroke-width="2"/>
|
|
79
79
|
<text x="156" y="341" text-anchor="end" font-size="14" font-weight="500" fill="currentColor" fill-opacity="0.82">Porffor</text>
|
|
80
|
-
<text x="156" y="356" text-anchor="end" font-size="10" fill="currentColor" fill-opacity="0.46">runs 4 /
|
|
81
|
-
<text x="662" y="349" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">3.
|
|
80
|
+
<text x="156" y="356" text-anchor="end" font-size="10" fill="currentColor" fill-opacity="0.46">runs 4 / 39</text>
|
|
81
|
+
<text x="662" y="349" font-size="13" font-weight="500" fill="currentColor" fill-opacity="0.6">3.80×</text>
|
|
82
82
|
<circle cx="182.0" cy="345" r="8" fill="currentColor" fill-opacity="0.4">
|
|
83
|
-
<animate attributeName="cx" dur="6.
|
|
83
|
+
<animate attributeName="cx" dur="6.076381324758255s" repeatCount="indefinite" calcMode="linear"
|
|
84
84
|
keyTimes="0;0.5;1" values="182.0;642.0;182.0" begin="-2.46s"/>
|
|
85
85
|
</circle>
|
|
86
86
|
</g>
|
|
87
87
|
<text x="360" y="390" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif" font-size="11" font-weight="600" fill="currentColor" fill-opacity="0.72">every rival compiled to WebAssembly, run in V8 · native C = reference</text>
|
|
88
|
-
<text x="360" y="408" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif" font-size="11" fill="currentColor" fill-opacity="0.5">geometric mean across
|
|
88
|
+
<text x="360" y="408" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif" font-size="11" fill="currentColor" fill-opacity="0.5">geometric mean across 39 benchmark cases · lower is faster, JZ = 1.00× baseline</text>
|
|
89
89
|
</svg>
|