boa
boa copied to clipboard
First prototype for new `JsString` using UTF-16
I think it's time to address the elephant in the room.
This Pull Request will (hopefully!) solve part of #736.
This is a complete rewrite of JsString
, but instead of storing u8
bytes it stores u16
words. The encode!
macro (renamed to utf16!
for simplicity) from the const-utf16
crate allows us to create UTF-16 encoded arrays at compilation time. JsString
implements Deref<Target=[u16]>
to unlock the slice methods and possibly make some manipulations easier. However, we would need to create our own library of utilities for JsString
.
In addition, the utf16_literal crate should be useful to convert runtime strings from String
to JsString
, but we could probably implement a parser ourselves.
Test262 conformance changes
VM implementation
Test result | main count | PR count | difference |
---|---|---|---|
Total | 92,565 | 92,565 | 0 |
Passed | 68,926 | 68,948 | +22 |
Ignored | 17,394 | 17,394 | 0 |
Failed | 6,245 | 6,223 | -22 |
Panics | 0 | 0 | 0 |
Conformance | 74.46% | 74.49% | +0.02% |
Fixed tests (30):
test/built-ins/encodeURIComponent/S15.1.3.4_A1.3_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.3_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.1_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.1_T2.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.1_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.1_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.2_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.2_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.2_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A1.2_T2.js (previously Failed)
test/built-ins/JSON/stringify/value-string-escape-ascii.js [strict mode] (previously Failed)
test/built-ins/JSON/stringify/value-string-escape-ascii.js (previously Failed)
test/built-ins/JSON/stringify/value-string-escape-unicode.js [strict mode] (previously Failed)
test/built-ins/JSON/stringify/value-string-escape-unicode.js (previously Failed)
test/built-ins/String/prototype/codePointAt/return-first-code-unit.js [strict mode] (previously Failed)
test/built-ins/String/prototype/codePointAt/return-first-code-unit.js (previously Failed)
test/built-ins/String/prototype/codePointAt/return-single-code-unit.js [strict mode] (previously Failed)
test/built-ins/String/prototype/codePointAt/return-single-code-unit.js (previously Failed)
test/built-ins/StringIteratorPrototype/next/next-iteration-surrogate-pairs.js [strict mode] (previously Failed)
test/built-ins/StringIteratorPrototype/next/next-iteration-surrogate-pairs.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.2_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.2_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.1_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.1_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.2_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.2_T2.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.1_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.1_T2.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.3_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A1.3_T1.js (previously Failed)
Broken tests (8):
test/built-ins/RegExp/dotall/with-dotall-unicode.js [strict mode] (previously Passed)
test/built-ins/RegExp/dotall/with-dotall-unicode.js (previously Passed)
test/built-ins/RegExp/dotall/without-dotall-unicode.js [strict mode] (previously Passed)
test/built-ins/RegExp/dotall/without-dotall-unicode.js (previously Passed)
test/language/literals/regexp/S7.8.5_A1.1_T2.js [strict mode] (previously Passed)
test/language/literals/regexp/S7.8.5_A1.1_T2.js (previously Passed)
test/language/literals/regexp/S7.8.5_A2.1_T2.js [strict mode] (previously Passed)
test/language/literals/regexp/S7.8.5_A2.1_T2.js (previously Passed)
Codecov Report
Merging #1659 (82b78f7) into main (07389cb) will decrease coverage by
0.10%
. The diff coverage is50.00%
.
@@ Coverage Diff @@
## main #1659 +/- ##
==========================================
- Coverage 40.93% 40.82% -0.11%
==========================================
Files 238 240 +2
Lines 22509 22743 +234
==========================================
+ Hits 9214 9285 +71
- Misses 13295 13458 +163
Impacted Files | Coverage Δ | |
---|---|---|
boa_engine/src/builtins/eval/mod.rs | 12.90% <0.00%> (+0.40%) |
:arrow_up: |
boa_engine/src/builtins/function/mod.rs | 23.73% <0.00%> (-0.37%) |
:arrow_down: |
boa_engine/src/builtins/intl/date_time_format.rs | 55.10% <0.00%> (-1.15%) |
:arrow_down: |
boa_engine/src/builtins/typed_array/mod.rs | 3.75% <0.00%> (-0.01%) |
:arrow_down: |
boa_engine/src/builtins/uri/mod.rs | 9.09% <0.00%> (ø) |
|
boa_engine/src/class.rs | 0.00% <ø> (ø) |
|
boa_engine/src/context/mod.rs | 30.73% <ø> (ø) |
|
boa_engine/src/lib.rs | 82.14% <ø> (ø) |
|
boa_engine/src/syntax/ast/node/template/mod.rs | 46.66% <0.00%> (-5.06%) |
:arrow_down: |
boa_tester/src/exec/js262.rs | 0.00% <ø> (ø) |
|
... and 88 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Benchmark for 4aee7ce
Click to view benchmark
Test | Base | PR | % |
---|---|---|---|
Arithmetic operations (Compiler) | 564.1±27.87ns | 582.7±75.83ns | +3.30% |
Arithmetic operations (Execution) | 2.6±0.13µs | 2.7±0.27µs | +3.85% |
Arithmetic operations (Parser) | 7.6±0.38µs | 7.5±0.32µs | -1.32% |
Array access (Compiler) | 1166.4±76.44ns | 1199.9±61.94ns | +2.87% |
Array access (Execution) | 14.3±2.93µs | 14.3±0.98µs | 0.00% |
Array access (Parser) | 16.0±1.00µs | 16.1±0.86µs | +0.63% |
Array creation (Compiler) | 1644.8±96.50ns | 1655.6±123.97ns | +0.66% |
Array creation (Execution) | 4.3±0.32ms | 4.0±0.27ms | -6.98% |
Array creation (Parser) | 17.8±1.36µs | 17.7±0.73µs | -0.56% |
Array pop (Compiler) | 3.9±0.18µs | 3.9±0.20µs | 0.00% |
Array pop (Execution) | 1847.6±210.60µs | 1726.3±116.35µs | -6.57% |
Array pop (Parser) | 197.6±12.44µs | 209.2±12.54µs | +5.87% |
Boolean Object Access (Compiler) | 1003.5±77.50ns | 984.8±68.53ns | -1.86% |
Boolean Object Access (Execution) | 9.5±0.60µs | 9.2±0.53µs | -3.16% |
Boolean Object Access (Parser) | 18.7±1.21µs | 18.8±1.00µs | +0.53% |
Clean js (Compiler) | 3.1±0.16µs | 3.2±0.41µs | +3.23% |
Clean js (Execution) | 1959.8±205.91µs | 1913.9±129.45µs | -2.34% |
Clean js (Parser) | 38.1±2.39µs | 39.8±4.79µs | +4.46% |
Create Realm | 434.5±27.62ns | 439.4±35.38ns | +1.13% |
Dynamic Object Property Access (Compiler) | 1614.8±114.98ns | 1624.2±133.34ns | +0.58% |
Dynamic Object Property Access (Execution) | 9.3±0.60µs | 9.7±0.67µs | +4.30% |
Dynamic Object Property Access (Parser) | 14.7±1.66µs | 14.5±1.00µs | -1.36% |
Fibonacci (Compiler) | 2.2±0.19µs | 2.2±0.10µs | 0.00% |
Fibonacci (Execution) | 4.1±0.28ms | 4.0±0.20ms | -2.44% |
Fibonacci (Parser) | 21.5±1.32µs | 22.2±1.37µs | +3.26% |
For loop (Compiler) | 1792.0±80.59ns | 1793.7±93.63ns | +0.09% |
For loop (Execution) | 58.8±4.67µs | 60.2±4.26µs | +2.38% |
For loop (Parser) | 19.1±2.43µs | 19.4±1.73µs | +1.57% |
Mini js (Compiler) | 3.2±0.72µs | 3.1±0.15µs | -3.13% |
Mini js (Execution) | 1775.1±76.73µs | 1765.1±78.25µs | -0.56% |
Mini js (Parser) | 33.4±5.70µs | 33.8±2.14µs | +1.20% |
Number Object Access (Compiler) | 938.6±40.43ns | 914.2±59.85ns | -2.60% |
Number Object Access (Execution) | 7.3±0.53µs | 7.6±0.49µs | +4.11% |
Number Object Access (Parser) | 14.7±0.92µs | 14.9±0.65µs | +1.36% |
Object Creation (Compiler) | 1384.0±98.98ns | 1399.7±113.76ns | +1.13% |
Object Creation (Execution) | 8.5±0.52µs | 8.8±0.55µs | +3.53% |
Object Creation (Parser) | 12.3±0.84µs | 12.7±1.16µs | +3.25% |
RegExp (Compiler) | 1578.7±113.50ns | 1590.9±80.37ns | +0.77% |
RegExp (Execution) | 17.2±1.15µs | 17.5±1.29µs | +1.74% |
RegExp (Parser) | 13.7±1.87µs | 14.0±1.31µs | +2.19% |
RegExp Creation (Compiler) | 1473.8±81.16ns | 1466.4±75.59ns | -0.50% |
RegExp Creation (Execution) | 12.8±0.64µs | 12.9±0.56µs | +0.78% |
RegExp Creation (Parser) | 11.3±0.93µs | 11.6±0.68µs | +2.65% |
RegExp Literal (Compiler) | 1680.1±208.63ns | 1620.1±88.26ns | -3.57% |
RegExp Literal (Execution) | 17.2±1.22µs | 17.8±2.09µs | +3.49% |
RegExp Literal (Parser) | 10.8±0.74µs | 11.3±1.63µs | +4.63% |
RegExp Literal Creation (Compiler) | 1496.1±92.33ns | 1439.5±96.80ns | -3.78% |
RegExp Literal Creation (Execution) | 13.0±1.73µs | 13.0±0.76µs | 0.00% |
RegExp Literal Creation (Parser) | 8.4±0.62µs | 8.7±0.89µs | +3.57% |
Static Object Property Access (Compiler) | 1407.0±100.29ns | 1405.4±70.54ns | -0.11% |
Static Object Property Access (Execution) | 9.1±0.70µs | 9.1±0.68µs | 0.00% |
Static Object Property Access (Parser) | 13.0±0.86µs | 13.8±1.07µs | +6.15% |
String Object Access (Compiler) | 1442.5±87.51ns | 1416.3±94.23ns | -1.82% |
String Object Access (Execution) | 11.7±0.77µs | 12.1±1.15µs | +3.42% |
String Object Access (Parser) | 17.9±0.78µs | 18.9±1.27µs | +5.59% |
String comparison (Compiler) | 1850.1±90.20ns | 1856.2±116.02ns | +0.33% |
String comparison (Execution) | 9.9±0.56µs | 10.1±0.81µs | +2.02% |
String comparison (Parser) | 14.6±1.04µs | 15.0±0.85µs | +2.74% |
String concatenation (Compiler) | 1554.1±114.18ns | 1504.8±143.27ns | -3.17% |
String concatenation (Execution) | 8.7±0.62µs | 8.8±0.76µs | +1.15% |
String concatenation (Parser) | 10.0±0.71µs | 10.4±0.66µs | +4.00% |
String copy (Compiler) | 1239.7±66.39ns | 1267.8±165.26ns | +2.27% |
String copy (Execution) | 7.5±0.71µs | 7.3±0.36µs | -2.67% |
String copy (Parser) | 7.4±0.44µs | 7.6±0.64µs | +2.70% |
Symbols (Compiler) | 944.0±47.55ns | 951.7±58.75ns | +0.82% |
Symbols (Execution) | 7.0±0.53µs | 7.1±1.35µs | +1.43% |
Symbols (Parser) | 5.8±0.32µs | 5.9±0.34µs | +1.72% |
Hi @jedel1043! Do you think you would be able to get back to this? This would be very nice to have :)
I'm still working on it locally :) I'll push incremental commits until I integrate the new type into all the builtins
Benchmark for f902625
Click to view benchmark
Test | Base | PR | % |
---|---|---|---|
Arithmetic operations (Compiler) | 398.7±0.55ns | 396.0±0.77ns | -0.68% |
Arithmetic operations (Execution) | 1730.5±3.13ns | 1963.3±64.78ns | +13.45% |
Arithmetic operations (Parser) | 5.5±0.01µs | 5.6±0.01µs | +1.82% |
Array access (Compiler) | 827.2±2.40ns | 828.0±2.04ns | +0.10% |
Array access (Execution) | 10.3±0.03µs | 10.4±0.03µs | +0.97% |
Array access (Parser) | 10.4±0.02µs | 12.0±0.02µs | +15.38% |
Array creation (Compiler) | 1154.2±2.80ns | 1181.8±3.46ns | +2.39% |
Array creation (Execution) | 3.2±0.01ms | 3.2±0.01ms | 0.00% |
Array creation (Parser) | 13.2±0.02µs | 13.4±0.02µs | +1.52% |
Array pop (Compiler) | 3.0±0.01µs | 3.0±0.01µs | 0.00% |
Array pop (Execution) | 1361.2±4.15µs | 1370.2±4.79µs | +0.66% |
Array pop (Parser) | 135.9±0.08µs | 137.2±0.13µs | +0.96% |
Boolean Object Access (Compiler) | 691.0±1.16ns | 712.2±1.18ns | +3.07% |
Boolean Object Access (Execution) | 6.8±0.02µs | 6.8±0.02µs | 0.00% |
Boolean Object Access (Parser) | 13.9±0.01µs | 14.1±0.02µs | +1.44% |
Clean js (Compiler) | 2.2±0.00µs | 2.2±0.01µs | 0.00% |
Clean js (Execution) | 1464.4±10.65µs | 1496.7±11.26µs | +2.21% |
Clean js (Parser) | 28.3±0.03µs | 28.6±0.04µs | +1.06% |
Create Realm | 329.1±0.21ns | 335.9±0.32ns | +2.07% |
Dynamic Object Property Access (Compiler) | 1140.9±2.49ns | 1163.1±3.74ns | +1.95% |
Dynamic Object Property Access (Execution) | 6.8±0.05µs | 6.9±0.04µs | +1.47% |
Dynamic Object Property Access (Parser) | 10.6±0.02µs | 10.7±0.03µs | +0.94% |
Fibonacci (Compiler) | 1468.2±3.29ns | 1471.3±3.66ns | +0.21% |
Fibonacci (Execution) | 2.7±0.00ms | 2.7±0.00ms | 0.00% |
Fibonacci (Parser) | 15.8±0.02µs | 16.0±0.05µs | +1.27% |
For loop (Compiler) | 1261.4±3.40ns | 1282.8±3.58ns | +1.70% |
For loop (Execution) | 43.7±0.17µs | 42.5±0.11µs | -2.75% |
For loop (Parser) | 13.5±0.03µs | 13.7±0.03µs | +1.48% |
Mini js (Compiler) | 2.2±0.01µs | 2.2±0.01µs | 0.00% |
Mini js (Execution) | 1204.6±7.60µs | 1362.3±7.69µs | +13.09% |
Mini js (Parser) | 24.8±0.02µs | 24.9±0.03µs | +0.40% |
Number Object Access (Compiler) | 647.9±1.49ns | 659.3±1.64ns | +1.76% |
Number Object Access (Execution) | 5.5±0.04µs | 5.3±0.02µs | -3.64% |
Number Object Access (Parser) | 11.0±0.01µs | 9.7±0.01µs | -11.82% |
Object Creation (Compiler) | 957.8±4.72ns | 971.4±2.58ns | +1.42% |
Object Creation (Execution) | 6.1±0.03µs | 6.3±0.04µs | +3.28% |
Object Creation (Parser) | 9.2±0.02µs | 9.3±0.03µs | +1.09% |
RegExp (Compiler) | 1153.0±6.03ns | 1135.3±1.40ns | -1.54% |
RegExp (Execution) | 13.1±0.06µs | 13.2±0.03µs | +0.76% |
RegExp (Parser) | 8.8±0.02µs | 10.2±0.06µs | +15.91% |
RegExp Creation (Compiler) | 1024.9±3.41ns | 1042.2±3.11ns | +1.69% |
RegExp Creation (Execution) | 9.9±0.06µs | 10.0±0.05µs | +1.01% |
RegExp Creation (Parser) | 8.3±0.02µs | 8.6±0.03µs | +3.61% |
RegExp Literal (Compiler) | 1123.0±6.26ns | 1160.4±4.06ns | +3.33% |
RegExp Literal (Execution) | 13.2±0.03µs | 11.6±0.03µs | -12.12% |
RegExp Literal (Parser) | 8.0±0.01µs | 7.3±0.01µs | -8.75% |
RegExp Literal Creation (Compiler) | 1021.9±3.17ns | 1029.9±2.64ns | +0.78% |
RegExp Literal Creation (Execution) | 9.9±0.05µs | 10.0±0.05µs | +1.01% |
RegExp Literal Creation (Parser) | 6.3±0.01µs | 6.4±0.01µs | +1.59% |
Static Object Property Access (Compiler) | 969.3±2.62ns | 982.6±2.46ns | +1.37% |
Static Object Property Access (Execution) | 6.4±0.03µs | 6.5±0.03µs | +1.56% |
Static Object Property Access (Parser) | 9.9±0.02µs | 10.0±0.03µs | +1.01% |
String Object Access (Compiler) | 1013.2±3.34ns | 1046.0±6.56ns | +3.24% |
String Object Access (Execution) | 8.7±0.08µs | 8.8±0.03µs | +1.15% |
String Object Access (Parser) | 13.7±0.03µs | 13.8±0.04µs | +0.73% |
String comparison (Compiler) | 1274.0±4.16ns | 1302.4±36.73ns | +2.23% |
String comparison (Execution) | 7.2±0.03µs | 6.3±0.03µs | -12.50% |
String comparison (Parser) | 10.6±0.02µs | 10.7±0.17µs | +0.94% |
String concatenation (Compiler) | 1043.7±1.68ns | 1053.0±3.54ns | +0.89% |
String concatenation (Execution) | 6.1±0.02µs | 6.1±0.02µs | 0.00% |
String concatenation (Parser) | 7.4±0.02µs | 7.4±0.04µs | 0.00% |
String copy (Compiler) | 773.0±1.92ns | 877.7±2.70ns | +13.54% |
String copy (Execution) | 5.2±0.02µs | 5.3±0.02µs | +1.92% |
String copy (Parser) | 5.5±0.01µs | 5.6±0.02µs | +1.82% |
Symbols (Compiler) | 639.3±1.20ns | 642.2±1.28ns | +0.45% |
Symbols (Execution) | 4.9±0.02µs | 5.0±0.03µs | +2.04% |
Symbols (Parser) | 3.7±0.01µs | 4.3±0.02µs | +16.22% |
Benchmark for c3d66b0
Click to view benchmark
Test | Base | PR | % |
---|---|---|---|
Arithmetic operations (Compiler) | 353.7±0.89ns | 343.9±0.65ns | -2.77% |
Arithmetic operations (Execution) | 1725.9±7.77ns | 1915.1±2.08ns | +10.96% |
Arithmetic operations (Parser) | 4.9±0.01µs | 4.9±0.01µs | 0.00% |
Array access (Compiler) | 724.5±4.91ns | 829.4±2.78ns | +14.48% |
Array access (Execution) | 9.1±0.05µs | 9.1±0.03µs | 0.00% |
Array access (Parser) | 10.6±0.02µs | 11.9±0.02µs | +12.26% |
Array creation (Compiler) | 1014.6±4.81ns | 1176.1±7.15ns | +15.92% |
Array creation (Execution) | 2.8±0.01ms | 2.9±0.01ms | +3.57% |
Array creation (Parser) | 11.8±0.02µs | 13.3±0.02µs | +12.71% |
Array pop (Compiler) | 2.6±0.01µs | 3.0±0.01µs | +15.38% |
Array pop (Execution) | 1204.0±3.91µs | 1373.0±4.87µs | +14.04% |
Array pop (Parser) | 137.4±0.53µs | 137.2±0.33µs | -0.15% |
Boolean Object Access (Compiler) | 606.5±2.08ns | 709.8±0.93ns | +17.03% |
Boolean Object Access (Execution) | 6.0±0.03µs | 6.0±0.01µs | 0.00% |
Boolean Object Access (Parser) | 14.2±0.03µs | 14.0±0.01µs | -1.41% |
Clean js (Compiler) | 2.2±0.00µs | 1952.3±6.92ns | -11.26% |
Clean js (Execution) | 1297.6±12.26µs | 1498.4±11.14µs | +15.47% |
Clean js (Parser) | 25.4±0.03µs | 28.6±0.19µs | +12.60% |
Create Realm | 328.2±0.13ns | 294.8±0.88ns | -10.18% |
Dynamic Object Property Access (Compiler) | 1016.9±5.12ns | 1167.5±12.46ns | +14.81% |
Dynamic Object Property Access (Execution) | 6.4±0.41µs | 6.1±0.06µs | -4.69% |
Dynamic Object Property Access (Parser) | 9.5±0.02µs | 10.6±0.01µs | +11.58% |
Fibonacci (Compiler) | 1465.1±4.14ns | 1296.1±2.92ns | -11.54% |
Fibonacci (Execution) | 2.4±0.00ms | 2.4±0.00ms | 0.00% |
Fibonacci (Parser) | 14.2±0.04µs | 14.1±0.03µs | -0.70% |
For loop (Compiler) | 1288.0±7.41ns | 1157.6±3.97ns | -10.12% |
For loop (Execution) | 38.2±0.13µs | 37.7±0.10µs | -1.31% |
For loop (Parser) | 12.1±0.03µs | 13.7±0.12µs | +13.22% |
Mini js (Compiler) | 2.1±0.00µs | 1948.4±5.81ns | -7.22% |
Mini js (Execution) | 1192.5±5.06µs | 1382.4±11.06µs | +15.92% |
Mini js (Parser) | 25.1±0.04µs | 25.0±0.03µs | -0.40% |
Number Object Access (Compiler) | 570.8±1.10ns | 672.2±1.57ns | +17.76% |
Number Object Access (Execution) | 4.8±0.03µs | 4.7±0.01µs | -2.08% |
Number Object Access (Parser) | 9.8±0.01µs | 9.7±0.02µs | -1.02% |
Object Creation (Compiler) | 972.9±3.26ns | 853.8±3.23ns | -12.24% |
Object Creation (Execution) | 5.4±0.02µs | 5.5±0.01µs | +1.85% |
Object Creation (Parser) | 8.2±0.02µs | 9.2±0.02µs | +12.20% |
RegExp (Compiler) | 1034.4±15.66ns | 1147.9±2.80ns | +10.97% |
RegExp (Execution) | 11.6±0.04µs | 11.5±0.03µs | -0.86% |
RegExp (Parser) | 9.0±0.01µs | 10.1±0.02µs | +12.22% |
RegExp Creation (Compiler) | 904.8±14.12ns | 1035.3±3.09ns | +14.42% |
RegExp Creation (Execution) | 8.8±0.06µs | 8.8±0.03µs | 0.00% |
RegExp Creation (Parser) | 8.5±0.02µs | 8.5±0.02µs | 0.00% |
RegExp Literal (Compiler) | 1020.4±19.18ns | 1157.0±3.53ns | +13.39% |
RegExp Literal (Execution) | 13.2±0.09µs | 11.5±0.04µs | -12.88% |
RegExp Literal (Parser) | 8.2±0.02µs | 7.2±0.02µs | -12.20% |
RegExp Literal Creation (Compiler) | 910.1±6.98ns | 1015.1±4.35ns | +11.54% |
RegExp Literal Creation (Execution) | 8.7±0.03µs | 8.7±0.11µs | 0.00% |
RegExp Literal Creation (Parser) | 5.7±0.02µs | 5.6±0.02µs | -1.75% |
Static Object Property Access (Compiler) | 849.2±2.96ns | 866.0±2.52ns | +1.98% |
Static Object Property Access (Execution) | 5.7±0.01µs | 5.7±0.01µs | 0.00% |
Static Object Property Access (Parser) | 8.8±0.02µs | 9.8±0.04µs | +11.36% |
String Object Access (Compiler) | 915.6±1.99ns | 1030.3±6.12ns | +12.53% |
String Object Access (Execution) | 8.8±0.09µs | 7.8±0.03µs | -11.36% |
String Object Access (Parser) | 13.9±0.02µs | 12.1±0.03µs | -12.95% |
String comparison (Compiler) | 1140.0±6.61ns | 1137.1±1.78ns | -0.25% |
String comparison (Execution) | 6.3±0.03µs | 6.3±0.02µs | 0.00% |
String comparison (Parser) | 10.8±0.01µs | 10.7±0.03µs | -0.93% |
String concatenation (Compiler) | 920.6±5.73ns | 931.7±2.03ns | +1.21% |
String concatenation (Execution) | 5.4±0.02µs | 5.3±0.01µs | -1.85% |
String concatenation (Parser) | 6.6±0.01µs | 6.7±0.34µs | +1.52% |
String copy (Compiler) | 754.0±2.71ns | 859.2±3.58ns | +13.95% |
String copy (Execution) | 4.6±0.03µs | 5.2±0.01µs | +13.04% |
String copy (Parser) | 5.6±0.01µs | 5.6±0.03µs | 0.00% |
Symbols (Compiler) | 650.2±1.81ns | 578.9±1.37ns | -10.97% |
Symbols (Execution) | 4.9±0.02µs | 4.4±0.01µs | -10.20% |
Symbols (Parser) | 3.8±0.02µs | 3.8±0.02µs | 0.00% |
Time to see how many tests break... 😅
Well, I expected to see more failed tests tbh, I'll probably fix those today or tomorrow. It could also be that we cannot parse string literals with UTF-16 codepoints; the interner automatically converts unpaired surrogates to \uFFFD
.
On another note, the interner doesn't support UTF-16 strings, so we will need to contribute to string-interner
the missing features.
These are the tests that are unfixable without an UTF-16 interner:
- https://github.com/tc39/test262/blob/main/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-string-wrapper.js
- https://github.com/tc39/test262/blob/main/test/built-ins/RegExp/prototype/exec/u-captured-value.js
- https://github.com/tc39/test262/blob/main/test/annexB/built-ins/String/prototype/substr/surrogate-pairs.js
- https://github.com/tc39/test262/blob/main/test/built-ins/String/prototype/padEnd/normal-operation.js
- https://github.com/tc39/test262/blob/main/test/built-ins/String/prototype/padStart/normal-operation.js
Well, I expected to see more failed tests tbh, I'll probably fix those today or tomorrow. It could also be that we cannot parse string literals with UTF-16 codepoints; the interner automatically converts unpaired surrogates to
\uFFFD
.On another note, the interner doesn't support UTF-16 strings, so we will need to contribute to
string-interner
the missing features.
Yes, but they might not want to add this feature, so we might end up needing to write our own interner. Let's see if we can open them an issue.
I'm gonna mark this as blocked on https://github.com/Robbepop/string-interner/pull/42. In the best case scenario, it'll get merged soon. Also, the two failing tests have to do with our (lack of) support for UTF-16 regex, so I'm gonna work on https://github.com/ridiculousfish/regress/issues/43 in the meantime.
OK, this is officially unblocked by #2147. I'll work on rebasing this today :)
Checked all the broken tests and all of them are related to our lack of UTF-16 handling in Regexp
. All tests previously passed because our string parser converted the unpaired surrogates to 0xFFFD
, which passed the equality test.
This shouldn't be a blocker then, and with some final contributions to regress
it should be solved on their next release.
Marking as ready for review since this is pretty much feature complete. It's still missing some docs adjustments but it would be good to have some reviews in the meantime.
Amost done with my review. We should probably do a benchmark on this right @jedel1043?
Yep, let me push to activate the bot
Hm, a segmentation fault that is only detected by benchmarks. That's really weird... I'll redesign the interner to see if that's the cause
Benchmark for 94c5586
Click to view benchmark
Test | Base | PR | % |
---|---|---|---|
Arithmetic operations (Compiler) | 510.0±1.07ns | 504.0±1.31ns | -1.18% |
Arithmetic operations (Execution) | 507.7±0.31ns | 509.8±0.66ns | +0.41% |
Arithmetic operations (Parser) | 6.3±0.01µs | 6.3±0.02µs | 0.00% |
Array access (Compiler) | 1517.0±3.54ns | 1537.7±4.31ns | +1.36% |
Array access (Execution) | 8.5±0.02µs | 11.3±0.03µs | +32.94% |
Array access (Parser) | 14.0±0.06µs | 13.8±0.04µs | -1.43% |
Array creation (Compiler) | 2.3±0.00µs | 2.4±0.00µs | +4.35% |
Array creation (Execution) | 2.4±0.01ms | 2.7±0.00ms | +12.50% |
Array creation (Parser) | 16.1±0.09µs | 15.8±0.04µs | -1.86% |
Array pop (Compiler) | 4.1±0.01µs | 4.1±0.01µs | 0.00% |
Array pop (Execution) | 1123.8±5.00µs | 1350.6±11.60µs | +20.18% |
Array pop (Parser) | 152.8±0.11µs | 154.2±0.24µs | +0.92% |
Boolean Object Access (Compiler) | 1167.3±8.89ns | 1161.5±2.55ns | -0.50% |
Boolean Object Access (Execution) | 4.5±0.02µs | 5.8±0.03µs | +28.89% |
Boolean Object Access (Parser) | 16.4±0.02µs | 16.6±0.04µs | +1.22% |
Clean js (Compiler) | 5.0±0.01µs | 5.0±0.01µs | 0.00% |
Clean js (Execution) | 742.8±3.90µs | 898.7±6.21µs | +20.99% |
Clean js (Parser) | 35.0±0.31µs | 34.4±0.09µs | -1.71% |
Create Realm | 242.9±0.16ns | 244.3±0.25ns | +0.58% |
Dynamic Object Property Access (Compiler) | 1816.6±3.90ns | 1834.2±4.66ns | +0.97% |
Dynamic Object Property Access (Execution) | 5.5±0.01µs | 6.4±0.03µs | +16.36% |
Dynamic Object Property Access (Parser) | 12.9±0.06µs | 12.5±0.03µs | -3.10% |
Fibonacci (Compiler) | 2.8±0.01µs | 2.8±0.01µs | 0.00% |
Fibonacci (Execution) | 1389.8±7.65µs | 1624.7±6.24µs | +16.90% |
Fibonacci (Parser) | 19.1±0.07µs | 18.9±0.10µs | -1.05% |
For loop (Compiler) | 2.7±0.02µs | 2.7±0.01µs | 0.00% |
For loop (Execution) | 16.6±0.04µs | 17.7±0.07µs | +6.63% |
For loop (Parser) | 16.4±0.04µs | 16.3±0.11µs | -0.61% |
Mini js (Compiler) | 4.4±0.05µs | 4.4±0.01µs | 0.00% |
Mini js (Execution) | 684.6±9.01µs | 846.3±18.40µs | +23.62% |
Mini js (Parser) | 30.6±0.09µs | 30.0±0.07µs | -1.96% |
Number Object Access (Compiler) | 1090.8±3.23ns | 1092.5±4.36ns | +0.16% |
Number Object Access (Execution) | 3.5±0.01µs | 4.4±0.02µs | +25.71% |
Number Object Access (Parser) | 12.8±0.02µs | 13.0±0.03µs | +1.56% |
Object Creation (Compiler) | 1605.3±5.37ns | 1622.5±8.23ns | +1.07% |
Object Creation (Execution) | 5.1±0.09µs | 6.1±0.02µs | +19.61% |
Object Creation (Parser) | 11.2±0.02µs | 10.9±0.05µs | -2.68% |
RegExp (Compiler) | 1842.2±6.34ns | 1819.6±7.33ns | -1.23% |
RegExp (Execution) | 12.4±0.07µs | 15.9±0.20µs | +28.23% |
RegExp (Parser) | 12.1±0.07µs | 11.7±0.02µs | -3.31% |
RegExp Creation (Compiler) | 1622.5±7.83ns | 1656.4±4.25ns | +2.09% |
RegExp Creation (Execution) | 9.3±0.04µs | 10.9±0.05µs | +17.20% |
RegExp Creation (Parser) | 10.0±0.02µs | 9.8±0.04µs | -2.00% |
RegExp Literal (Compiler) | 1832.0±4.24ns | 1838.8±4.25ns | +0.37% |
RegExp Literal (Execution) | 12.4±0.07µs | 15.9±0.29µs | +28.23% |
RegExp Literal (Parser) | 10.1±0.02µs | 9.5±0.02µs | -5.94% |
RegExp Literal Creation (Compiler) | 1633.9±8.56ns | 1666.6±2.99ns | +2.00% |
RegExp Literal Creation (Execution) | 9.2±0.04µs | 11.5±0.47µs | +25.00% |
RegExp Literal Creation (Parser) | 7.8±0.03µs | 7.6±0.02µs | -2.56% |
Static Object Property Access (Compiler) | 1624.3±7.62ns | 1649.2±7.20ns | +1.53% |
Static Object Property Access (Execution) | 5.3±0.04µs | 6.3±0.02µs | +18.87% |
Static Object Property Access (Parser) | 11.9±0.06µs | 11.6±0.04µs | -2.52% |
String Object Access (Compiler) | 1463.2±5.18ns | 1513.5±9.09ns | +3.44% |
String Object Access (Execution) | 6.6±0.02µs | 8.2±0.03µs | +24.24% |
String Object Access (Parser) | 16.0±0.02µs | 16.2±0.10µs | +1.25% |
String comparison (Compiler) | 2.3±0.01µs | 2.4±0.01µs | +4.35% |
String comparison (Execution) | 4.7±0.04µs | 5.5±0.02µs | +17.02% |
String comparison (Parser) | 13.3±0.02µs | 12.7±0.05µs | -4.51% |
String concatenation (Compiler) | 1791.3±4.28ns | 1811.6±3.94ns | +1.13% |
String concatenation (Execution) | 4.5±0.01µs | 5.4±0.02µs | +20.00% |
String concatenation (Parser) | 9.2±0.03µs | 8.9±0.03µs | -3.26% |
String copy (Compiler) | 1470.8±0.85ns | 1505.5±3.70ns | +2.36% |
String copy (Execution) | 4.3±0.02µs | 5.0±0.01µs | +16.28% |
String copy (Parser) | 6.9±0.02µs | 6.9±0.04µs | 0.00% |
Symbols (Compiler) | 1126.2±2.91ns | 1125.3±2.97ns | -0.08% |
Symbols (Execution) | 4.3±0.02µs | 5.1±0.03µs | +18.60% |
Symbols (Parser) | 5.4±0.01µs | 5.1±0.02µs | -5.56% |
Benchmark for 010e382
Click to view benchmark
Test | Base | PR | % |
---|---|---|---|
Arithmetic operations (Compiler) | 466.6±1.46ns | 561.1±1.63ns | +20.25% |
Arithmetic operations (Execution) | 739.0±4.29ns | 623.6±0.37ns | -15.62% |
Arithmetic operations (Parser) | 5.8±0.01µs | 5.7±0.01µs | -1.72% |
Array access (Compiler) | 1416.3±3.16ns | 1427.6±8.55ns | +0.80% |
Array access (Execution) | 8.2±0.03µs | 10.3±0.03µs | +25.61% |
Array access (Parser) | 12.9±0.09µs | 12.8±0.02µs | -0.78% |
Array creation (Compiler) | 2.2±0.01µs | 2.2±0.01µs | 0.00% |
Array creation (Execution) | 2.5±0.01ms | 2.7±0.00ms | +8.00% |
Array creation (Parser) | 13.2±0.02µs | 14.7±0.02µs | +11.36% |
Array pop (Compiler) | 4.1±0.01µs | 4.0±0.01µs | -2.44% |
Array pop (Execution) | 1131.8±5.59µs | 1312.2±6.13µs | +15.94% |
Array pop (Parser) | 143.4±0.21µs | 142.4±0.19µs | -0.70% |
Boolean Object Access (Compiler) | 1005.7±3.04ns | 990.4±2.78ns | -1.52% |
Boolean Object Access (Execution) | 4.3±0.01µs | 5.3±0.01µs | +23.26% |
Boolean Object Access (Parser) | 15.6±0.02µs | 13.5±0.02µs | -13.46% |
Clean js (Compiler) | 4.1±0.01µs | 4.6±0.01µs | +12.20% |
Clean js (Execution) | 725.0±3.29µs | 747.7±3.33µs | +3.13% |
Clean js (Parser) | 32.4±0.14µs | 28.1±0.03µs | -13.27% |
Create Realm | 235.3±0.18ns | 241.0±0.57ns | +2.42% |
Dynamic Object Property Access (Compiler) | 1709.7±5.53ns | 1514.8±3.32ns | -11.40% |
Dynamic Object Property Access (Execution) | 5.4±0.02µs | 5.6±0.23µs | +3.70% |
Dynamic Object Property Access (Parser) | 11.6±0.02µs | 10.2±0.02µs | -12.07% |
Fibonacci (Compiler) | 2.6±0.01µs | 2.6±0.01µs | 0.00% |
Fibonacci (Execution) | 1346.2±3.36µs | 1531.6±3.79µs | +13.77% |
Fibonacci (Parser) | 17.5±0.02µs | 17.1±0.02µs | -2.29% |
For loop (Compiler) | 2.5±0.01µs | 2.5±0.01µs | 0.00% |
For loop (Execution) | 17.2±0.05µs | 17.6±0.08µs | +2.33% |
For loop (Parser) | 15.2±0.02µs | 15.2±0.04µs | 0.00% |
Mini js (Compiler) | 3.6±0.02µs | 4.1±0.01µs | +13.89% |
Mini js (Execution) | 671.4±3.41µs | 702.1±3.72µs | +4.57% |
Mini js (Parser) | 28.2±0.03µs | 27.7±0.04µs | -1.77% |
Number Object Access (Compiler) | 959.3±1.54ns | 1070.6±4.05ns | +11.60% |
Number Object Access (Execution) | 3.4±0.01µs | 4.1±0.01µs | +20.59% |
Number Object Access (Parser) | 12.2±0.02µs | 12.1±0.05µs | -0.82% |
Object Creation (Compiler) | 1497.1±4.87ns | 1522.2±3.99ns | +1.68% |
Object Creation (Execution) | 5.1±0.01µs | 5.8±0.02µs | +13.73% |
Object Creation (Parser) | 10.2±0.03µs | 10.1±0.02µs | -0.98% |
RegExp (Compiler) | 1688.2±6.53ns | 1516.8±12.78ns | -10.15% |
RegExp (Execution) | 12.4±0.04µs | 13.2±0.03µs | +6.45% |
RegExp (Parser) | 11.2±0.02µs | 9.7±0.02µs | -13.39% |
RegExp Creation (Compiler) | 1344.2±3.68ns | 1378.6±10.70ns | +2.56% |
RegExp Creation (Execution) | 8.2±0.03µs | 9.1±0.05µs | +10.98% |
RegExp Creation (Parser) | 8.4±0.02µs | 9.2±0.01µs | +9.52% |
RegExp Literal (Compiler) | 1490.8±2.94ns | 1511.0±8.81ns | +1.35% |
RegExp Literal (Execution) | 12.3±0.04µs | 13.3±0.03µs | +8.13% |
RegExp Literal (Parser) | 8.0±0.01µs | 8.8±0.02µs | +10.00% |
RegExp Literal Creation (Compiler) | 1330.3±5.78ns | 1352.1±5.49ns | +1.64% |
RegExp Literal Creation (Execution) | 9.2±0.05µs | 9.2±0.04µs | 0.00% |
RegExp Literal Creation (Parser) | 7.1±0.01µs | 6.9±0.07µs | -2.82% |
Static Object Property Access (Compiler) | 1512.2±4.11ns | 1529.7±4.01ns | +1.16% |
Static Object Property Access (Execution) | 5.3±0.01µs | 6.1±0.20µs | +15.09% |
Static Object Property Access (Parser) | 10.9±0.01µs | 9.5±0.02µs | -12.84% |
String Object Access (Compiler) | 1247.0±1.30ns | 1262.9±4.80ns | +1.28% |
String Object Access (Execution) | 6.1±0.03µs | 6.8±0.07µs | +11.48% |
String Object Access (Parser) | 15.1±0.02µs | 15.1±0.16µs | 0.00% |
String comparison (Compiler) | 2.2±0.00µs | 1935.0±7.03ns | -12.05% |
String comparison (Execution) | 4.7±0.05µs | 5.2±0.03µs | +10.64% |
String comparison (Parser) | 11.7±0.01µs | 11.8±0.02µs | +0.85% |
String concatenation (Compiler) | 5.1±0.07µs | 1509.9±16.24ns | -70.39% |
String concatenation (Execution) | 4.4±0.05µs | 5.0±0.02µs | +13.64% |
String concatenation (Parser) | 8.2±0.01µs | 8.3±0.01µs | +1.22% |
String copy (Compiler) | 1386.3±3.17ns | 1388.8±6.34ns | +0.18% |
String copy (Execution) | 4.1±0.02µs | 4.7±0.02µs | +14.63% |
String copy (Parser) | 6.2±0.01µs | 6.2±0.01µs | 0.00% |
Symbols (Compiler) | 1068.1±2.68ns | 1065.1±1.89ns | -0.28% |
Symbols (Execution) | 4.2±0.02µs | 4.9±0.02µs | +16.67% |
Symbols (Parser) | 4.3±0.01µs | 4.7±0.01µs | +9.30% |
Hmmm benchmarks show a clear regression :(
Hmmm benchmarks show a clear regression :(
Understandable, since we now have to use double the memory to store strings. That's not cache friendly at all. On the other hand, we still need UTF-16 strings for correctness.
I was thinking about some possible optimizations, and I think we could optimize JsString
by only storing UTF-16
if the string has characters outside of the ASCII range, and storing only ASCII otherwise, but that would require a bit more design effort.
I was thinking about some possible optimizations, and I think we could optimize
JsString
by only storingUTF-16
if the string has characters outside of the ASCII range, and storing only ASCII otherwise, but that would require a bit more design effort.
AFAIK V8 and spidermoney does this optimization, I think this could be done after we merge this first, since this PR is already huge
I was thinking about some possible optimizations, and I think we could optimize
JsString
by only storingUTF-16
if the string has characters outside of the ASCII range, and storing only ASCII otherwise, but that would require a bit more design effort.AFAIK V8 and spidermoney does this optimization, I think this could be done after we merge this first, since this PR is already huge
@jedel1043, @HalidOdat, @Razican Since we are at the start of 0.17 now, do we want to rebase, review and merge this as is and set a goal to improve the performance until the 0.17 release?
+1 for @raskad 's suggestion, but I'm pretty much biased haha
I think we can merge it as-is, yes :) then improve performance before 0.17
Rebased!
Benchmark for b2bc001
Click to view benchmark
Test | Base | PR | % |
---|---|---|---|
Arithmetic operations (Compiler) | 668.1±35.79ns | 653.5±47.45ns | -2.19% |
Arithmetic operations (Execution) | 770.6±39.00ns | 747.0±38.71ns | -3.06% |
Arithmetic operations (Parser) | 7.8±0.50µs | 7.5±0.46µs | -3.85% |
Array access (Compiler) | 1897.4±131.88ns | 1939.2±80.56ns | +2.20% |
Array access (Execution) | 8.8±0.47µs | 11.9±1.17µs | +35.23% |
Array access (Parser) | 16.4±0.73µs | 16.7±0.81µs | +1.83% |
Array creation (Compiler) | 2.9±0.14µs | 2.8±0.14µs | -3.45% |
Array creation (Execution) | 1277.7±66.54µs | 1528.3±133.09µs | +19.61% |
Array creation (Parser) | 19.1±0.87µs | 19.5±0.76µs | +2.09% |
Array pop (Compiler) | 5.4±0.20µs | 5.1±0.24µs | -5.56% |
Array pop (Execution) | 685.6±46.05µs | 920.6±51.96µs | +34.28% |
Array pop (Parser) | 190.6±9.82µs | 193.7±6.82µs | +1.63% |
Boolean Object Access (Compiler) | 1464.0±113.84ns | 1380.7±69.56ns | -5.69% |
Boolean Object Access (Execution) | 5.5±0.30µs | 6.4±0.37µs | +16.36% |
Boolean Object Access (Parser) | 18.4±0.91µs | 18.8±1.08µs | +2.17% |
Clean js (Compiler) | 6.1±0.31µs | 6.5±0.37µs | +6.56% |
Clean js (Execution) | 749.6±49.34µs | 931.9±38.19µs | +24.32% |
Clean js (Parser) | 40.1±2.97µs | 39.8±3.53µs | -0.75% |
Create Realm | 286.9±16.85ns | 294.0±15.28ns | +2.47% |
Dynamic Object Property Access (Compiler) | 2.3±0.13µs | 2.2±0.13µs | -4.35% |
Dynamic Object Property Access (Execution) | 6.1±0.35µs | 6.9±0.57µs | +13.11% |
Dynamic Object Property Access (Parser) | 14.8±0.79µs | 14.4±0.79µs | -2.70% |
Fibonacci (Compiler) | 3.5±0.18µs | 3.6±0.12µs | +2.86% |
Fibonacci (Execution) | 1351.0±51.47µs | 1520.8±64.87µs | +12.57% |
Fibonacci (Parser) | 22.3±1.58µs | 22.2±1.46µs | -0.45% |
For loop (Compiler) | 3.1±0.18µs | 3.3±0.14µs | +6.45% |
For loop (Execution) | 21.1±1.06µs | 22.2±1.24µs | +5.21% |
For loop (Parser) | 19.2±1.05µs | 20.4±2.65µs | +6.25% |
Mini js (Compiler) | 5.2±0.33µs | 5.3±0.31µs | +1.92% |
Mini js (Execution) | 654.9±40.30µs | 829.9±31.68µs | +26.72% |
Mini js (Parser) | 34.8±1.72µs | 32.9±1.72µs | -5.46% |
Number Object Access (Compiler) | 1335.7±128.16ns | 1362.1±89.61ns | +1.98% |
Number Object Access (Execution) | 4.3±0.20µs | 5.3±0.27µs | +23.26% |
Number Object Access (Parser) | 14.8±0.73µs | 15.0±0.66µs | +1.35% |
Object Creation (Compiler) | 1996.8±135.10ns | 1943.5±103.47ns | -2.67% |
Object Creation (Execution) | 5.6±0.28µs | 6.7±0.44µs | +19.64% |
Object Creation (Parser) | 12.8±0.66µs | 12.6±0.69µs | -1.56% |
RegExp (Compiler) | 2.2±0.12µs | 2.2±0.13µs | 0.00% |
RegExp (Execution) | 14.3±1.07µs | 18.5±0.60µs | +29.37% |
RegExp (Parser) | 13.9±0.81µs | 13.8±0.83µs | -0.72% |
RegExp Creation (Compiler) | 1967.8±107.67ns | 2.1±0.09µs | +6.72% |
RegExp Creation (Execution) | 10.5±0.44µs | 11.7±0.54µs | +11.43% |
RegExp Creation (Parser) | 11.5±0.62µs | 11.8±0.61µs | +2.61% |
RegExp Literal (Compiler) | 2.2±0.11µs | 2.3±0.18µs | +4.55% |
RegExp Literal (Execution) | 14.3±0.67µs | 18.3±1.11µs | +27.97% |
RegExp Literal (Parser) | 11.1±0.82µs | 11.1±0.37µs | 0.00% |
RegExp Literal Creation (Compiler) | 1989.8±97.30ns | 2.1±0.08µs | +5.54% |
RegExp Literal Creation (Execution) | 10.4±0.59µs | 12.5±0.51µs | +20.19% |
RegExp Literal Creation (Parser) | 8.7±0.58µs | 8.9±0.34µs | +2.30% |
Static Object Property Access (Compiler) | 2.1±0.21µs | 2.0±0.09µs | -4.76% |
Static Object Property Access (Execution) | 6.0±0.31µs | 6.9±0.43µs | +15.00% |
Static Object Property Access (Parser) | 14.2±0.87µs | 13.8±0.85µs | -2.82% |
String Object Access (Compiler) | 1826.4±68.43ns | 1842.3±102.70ns | +0.87% |
String Object Access (Execution) | 7.9±0.57µs | 9.7±0.58µs | +22.78% |
String Object Access (Parser) | 18.0±1.03µs | 18.2±0.94µs | +1.11% |
String comparison (Compiler) | 2.8±0.15µs | 2.9±0.13µs | +3.57% |
String comparison (Execution) | 5.3±0.56µs | 5.9±0.34µs | +11.32% |
String comparison (Parser) | 14.9±0.93µs | 15.0±0.74µs | +0.67% |
String concatenation (Compiler) | 2.2±0.12µs | 2.3±0.11µs | +4.55% |
String concatenation (Execution) | 4.9±0.31µs | 5.4±0.33µs | +10.20% |
String concatenation (Parser) | 10.6±0.60µs | 10.7±0.81µs | +0.94% |
String copy (Compiler) | 1768.1±111.20ns | 1828.4±102.52ns | +3.41% |
String copy (Execution) | 4.5±0.23µs | 5.2±0.26µs | +15.56% |
String copy (Parser) | 7.9±0.35µs | 8.1±0.46µs | +2.53% |
Symbols (Compiler) | 1455.1±73.63ns | 1392.7±67.88ns | -4.29% |
Symbols (Execution) | 4.6±0.28µs | 5.4±0.31µs | +17.39% |
Symbols (Parser) | 6.1±0.36µs | 6.0±0.54µs | -1.64% |
Benchmark for 51affed
Click to view benchmark
Test | Base | PR | % |
---|---|---|---|
Arithmetic operations (Compiler) | 508.3±1.36ns | 488.9±0.75ns | -3.82% |
Arithmetic operations (Execution) | 523.8±0.46ns | 530.7±0.50ns | +1.32% |
Arithmetic operations (Parser) | 6.7±0.05µs | 6.9±0.07µs | +2.99% |
Array access (Compiler) | 1479.7±6.92ns | 1458.9±6.92ns | -1.41% |
Array access (Execution) | 7.5±0.02µs | 9.8±0.02µs | +30.67% |
Array access (Parser) | 14.6±0.04µs | 14.9±0.08µs | +2.05% |
Array creation (Compiler) | 2.3±0.01µs | 2.3±0.01µs | 0.00% |
Array creation (Execution) | 1211.4±23.06µs | 1385.3±6.46µs | +14.36% |
Array creation (Parser) | 17.0±0.05µs | 17.2±0.06µs | +1.18% |
Array pop (Compiler) | 4.1±0.02µs | 4.1±0.01µs | 0.00% |
Array pop (Execution) | 631.6±2.75µs | 838.8±3.13µs | +32.81% |
Array pop (Parser) | 159.5±0.15µs | 156.9±0.19µs | -1.63% |
Boolean Object Access (Compiler) | 1177.4±4.11ns | 1158.0±11.51ns | -1.65% |
Boolean Object Access (Execution) | 4.5±0.01µs | 5.8±0.22µs | +28.89% |
Boolean Object Access (Parser) | 16.7±0.11µs | 16.9±0.04µs | +1.20% |
Clean js (Compiler) | 5.0±0.01µs | 5.1±0.01µs | +2.00% |
Clean js (Execution) | 644.1±3.89µs | 794.3±3.05µs | +23.32% |
Clean js (Parser) | 35.2±0.10µs | 35.2±0.07µs | 0.00% |
Create Realm | 248.9±0.32ns | 247.6±1.20ns | -0.52% |
Dynamic Object Property Access (Compiler) | 1789.2±8.97ns | 1802.1±10.28ns | +0.72% |
Dynamic Object Property Access (Execution) | 4.9±0.02µs | 5.6±0.01µs | +14.29% |
Dynamic Object Property Access (Parser) | 13.3±0.11µs | 13.5±0.06µs | +1.50% |
Fibonacci (Compiler) | 2.8±0.01µs | 2.8±0.01µs | 0.00% |
Fibonacci (Execution) | 1117.1±10.31µs | 1251.3±12.12µs | +12.01% |
Fibonacci (Parser) | 20.4±0.07µs | 20.1±0.07µs | -1.47% |
For loop (Compiler) | 2.6±0.01µs | 2.7±0.02µs | +3.85% |
For loop (Execution) | 16.5±0.04µs | 17.3±0.03µs | +4.85% |
For loop (Parser) | 17.5±0.03µs | 17.7±0.04µs | +1.14% |
Mini js (Compiler) | 4.4±0.01µs | 4.4±0.04µs | 0.00% |
Mini js (Execution) | 577.4±5.41µs | 729.9±4.50µs | +26.41% |
Mini js (Parser) | 30.6±0.16µs | 30.3±0.11µs | -0.98% |
Number Object Access (Compiler) | 1087.6±2.15ns | 1083.8±23.64ns | -0.35% |
Number Object Access (Execution) | 3.4±0.01µs | 4.5±0.01µs | +32.35% |
Number Object Access (Parser) | 13.1±0.11µs | 13.4±0.03µs | +2.29% |
Object Creation (Compiler) | 1586.6±8.85ns | 1551.6±5.48ns | -2.21% |
Object Creation (Execution) | 4.6±0.01µs | 5.3±0.02µs | +15.22% |
Object Creation (Parser) | 11.7±0.05µs | 11.8±0.08µs | +0.85% |
RegExp (Compiler) | 1815.6±11.55ns | 1771.3±9.40ns | -2.44% |
RegExp (Execution) | 11.7±0.03µs | 14.7±0.06µs | +25.64% |
RegExp (Parser) | 12.7±0.06µs | 12.7±0.04µs | 0.00% |
RegExp Creation (Compiler) | 1579.5±3.16ns | 1598.5±7.67ns | +1.20% |
RegExp Creation (Execution) | 8.6±0.03µs | 9.9±0.04µs | +15.12% |
RegExp Creation (Parser) | 10.6±0.06µs | 10.7±0.05µs | +0.94% |
RegExp Literal (Compiler) | 1797.4±8.82ns | 1777.7±7.66ns | -1.10% |
RegExp Literal (Execution) | 11.7±0.03µs | 14.7±0.06µs | +25.64% |
RegExp Literal (Parser) | 10.2±0.03µs | 10.2±0.03µs | 0.00% |
RegExp Literal Creation (Compiler) | 1595.9±3.89ns | 1588.5±5.74ns | -0.46% |
RegExp Literal Creation (Execution) | 8.6±0.03µs | 9.9±0.03µs | +15.12% |
RegExp Literal Creation (Parser) | 8.0±0.02µs | 8.1±0.02µs | +1.25% |
Static Object Property Access (Compiler) | 1612.5±8.76ns | 1562.1±4.58ns | -3.13% |
Static Object Property Access (Execution) | 4.8±0.02µs | 5.5±0.02µs | +14.58% |
Static Object Property Access (Parser) | 12.5±0.05µs | 12.6±0.07µs | +0.80% |
String Object Access (Compiler) | 1464.1±5.35ns | 1477.6±4.90ns | +0.92% |
String Object Access (Execution) | 6.3±0.03µs | 8.4±0.12µs | +33.33% |
String Object Access (Parser) | 16.3±0.07µs | 16.5±0.04µs | +1.23% |
String comparison (Compiler) | 2.3±0.01µs | 2.4±0.01µs | +4.35% |
String comparison (Execution) | 4.2±0.02µs | 4.7±0.01µs | +11.90% |
String comparison (Parser) | 13.5±0.01µs | 13.9±0.05µs | +2.96% |
String concatenation (Compiler) | 1775.7±8.11ns | 1775.3±8.22ns | -0.02% |
String concatenation (Execution) | 4.0±0.01µs | 4.4±0.01µs | +10.00% |
String concatenation (Parser) | 9.5±0.03µs | 9.7±0.05µs | +2.11% |
String copy (Compiler) | 1430.3±3.46ns | 1468.6±6.57ns | +2.68% |
String copy (Execution) | 3.7±0.01µs | 4.2±0.02µs | +13.51% |
String copy (Parser) | 7.2±0.03µs | 7.4±0.04µs | +2.78% |
Symbols (Compiler) | 1067.6±10.94ns | 1063.0±2.52ns | -0.43% |
Symbols (Execution) | 3.8±0.02µs | 4.3±0.01µs | +13.16% |
Symbols (Parser) | 5.7±0.02µs | 5.8±0.06µs | +1.75% |