Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Reduced the size of AST nodes #1821

Closed
wants to merge 3 commits into from

Conversation

Razican
Copy link
Member

@Razican Razican commented Feb 5, 2022

This PR boxes the Try and TaggedTemplate nodes reducing the size of the Node structure from 88 to 56 bytes. This should improve performance in most cases, by adding another indirection with code with try and templates.

@Razican Razican added performance Performance related changes and issues ast Issue surrounding the abstract syntax tree labels Feb 5, 2022
@Razican Razican added this to the v0.14.0 milestone Feb 5, 2022
@github-actions
Copy link

github-actions bot commented Feb 5, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 87,912 87,912 0
Passed 40,892 40,892 0
Ignored 19,929 19,929 0
Failed 27,091 27,091 0
Panics 0 0 0
Conformance 46.51% 46.51% 0.00%

@codecov
Copy link

codecov bot commented Feb 5, 2022

Codecov Report

Merging #1821 (12283eb) into main (55e85ad) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1821      +/-   ##
==========================================
- Coverage   55.73%   55.71%   -0.02%     
==========================================
  Files         201      201              
  Lines       17326    17326              
==========================================
- Hits         9656     9654       -2     
- Misses       7670     7672       +2     
Impacted Files Coverage Δ
boa/src/syntax/ast/node/mod.rs 76.27% <ø> (ø)
boa/src/syntax/ast/node/template/mod.rs 48.48% <100.00%> (ø)
boa/src/syntax/ast/node/try_node/mod.rs 85.71% <100.00%> (ø)
boa/src/bytecompiler.rs 59.32% <0.00%> (-0.20%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55e85ad...12283eb. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Feb 6, 2022

Benchmark for 5b08ad6

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 469.1±46.30ns 450.6±37.49ns -3.94%
Arithmetic operations (Execution) 2.1±0.18µs 2.1±0.16µs 0.00%
Arithmetic operations (Parser) 5.9±0.52µs 5.8±0.44µs -1.69%
Array access (Compiler) 963.5±75.70ns 987.4±77.16ns +2.48%
Array access (Execution) 10.8±0.65µs 11.5±1.05µs +6.48%
Array access (Parser) 13.0±1.26µs 12.2±0.78µs -6.15%
Array creation (Compiler) 1310.1±114.70ns 1273.3±78.67ns -2.81%
Array creation (Execution) 3.3±0.25ms 3.9±0.26ms +18.18%
Array creation (Parser) 13.9±1.19µs 13.5±0.92µs -2.88%
Array pop (Compiler) 3.1±0.23µs 3.0±0.25µs -3.23%
Array pop (Execution) 1438.7±113.00µs 1510.1±87.51µs +4.96%
Array pop (Parser) 155.7±11.52µs 149.3±9.83µs -4.11%
Boolean Object Access (Compiler) 816.2±89.72ns 807.0±82.02ns -1.13%
Boolean Object Access (Execution) 7.4±0.58µs 7.6±0.65µs +2.70%
Boolean Object Access (Parser) 14.4±1.32µs 14.7±1.34µs +2.08%
Clean js (Compiler) 2.6±0.27µs 2.5±0.28µs -3.85%
Clean js (Execution) 1490.9±103.50µs 1563.9±150.00µs +4.90%
Clean js (Parser) 30.5±2.81µs 30.0±2.40µs -1.64%
Create Realm 346.0±26.17ns 364.2±41.00ns +5.26%
Dynamic Object Property Access (Compiler) 1321.0±101.07ns 1365.2±129.46ns +3.35%
Dynamic Object Property Access (Execution) 7.8±1.01µs 7.7±0.58µs -1.28%
Dynamic Object Property Access (Parser) 11.2±1.01µs 11.2±0.94µs 0.00%
Fibonacci (Compiler) 1714.9±126.16ns 1644.4±114.05ns -4.11%
Fibonacci (Execution) 3.2±0.29ms 3.2±0.19ms 0.00%
Fibonacci (Parser) 17.2±1.32µs 17.0±1.39µs -1.16%
For loop (Compiler) 1450.9±83.43ns 1428.4±151.41ns -1.55%
For loop (Execution) 47.1±3.78µs 46.4±3.01µs -1.49%
For loop (Parser) 14.3±1.03µs 14.6±1.12µs +2.10%
Mini js (Compiler) 2.6±0.28µs 2.5±0.18µs -3.85%
Mini js (Execution) 1397.7±123.74µs 1456.8±110.55µs +4.23%
Mini js (Parser) 26.3±2.05µs 26.0±1.78µs -1.14%
Number Object Access (Compiler) 760.2±61.66ns 740.7±83.72ns -2.57%
Number Object Access (Execution) 5.8±0.41µs 5.7±0.49µs -1.72%
Number Object Access (Parser) 11.1±0.78µs 11.7±0.84µs +5.41%
Object Creation (Compiler) 1122.8±97.94ns 1110.0±95.23ns -1.14%
Object Creation (Execution) 6.8±0.66µs 6.9±0.54µs +1.47%
Object Creation (Parser) 9.5±0.62µs 9.6±1.07µs +1.05%
RegExp (Compiler) 1279.6±101.67ns 1292.8±91.06ns +1.03%
RegExp (Execution) 13.7±1.13µs 13.9±1.22µs +1.46%
RegExp (Parser) 10.5±0.98µs 10.4±0.77µs -0.95%
RegExp Creation (Compiler) 1227.9±102.19ns 1200.9±77.44ns -2.20%
RegExp Creation (Execution) 10.4±0.78µs 10.7±0.90µs +2.88%
RegExp Creation (Parser) 8.5±0.49µs 8.7±0.70µs +2.35%
RegExp Literal (Compiler) 1314.6±111.52ns 1298.1±96.24ns -1.26%
RegExp Literal (Execution) 13.7±1.50µs 13.7±1.05µs 0.00%
RegExp Literal (Parser) 8.7±0.68µs 8.4±0.77µs -3.45%
RegExp Literal Creation (Compiler) 1224.4±98.15ns 1192.0±105.31ns -2.65%
RegExp Literal Creation (Execution) 10.5±0.82µs 10.3±0.79µs -1.90%
RegExp Literal Creation (Parser) 6.5±0.46µs 6.5±0.51µs 0.00%
Static Object Property Access (Compiler) 1153.4±107.43ns 1089.3±70.82ns -5.56%
Static Object Property Access (Execution) 7.0±0.48µs 7.3±0.58µs +4.29%
Static Object Property Access (Parser) 10.5±1.04µs 10.4±0.76µs -0.95%
String Object Access (Compiler) 1142.3±79.86ns 1123.5±111.27ns -1.65%
String Object Access (Execution) 9.6±0.94µs 9.5±0.59µs -1.04%
String Object Access (Parser) 15.4±1.35µs 14.7±1.12µs -4.55%
String comparison (Compiler) 1476.8±128.49ns 1480.4±119.52ns +0.24%
String comparison (Execution) 7.8±0.83µs 7.7±0.57µs -1.28%
String comparison (Parser) 11.6±0.92µs 11.5±0.89µs -0.86%
String concatenation (Compiler) 1181.8±72.12ns 1212.8±84.59ns +2.62%
String concatenation (Execution) 7.1±0.69µs 6.8±1.15µs -4.23%
String concatenation (Parser) 8.0±0.63µs 7.9±0.65µs -1.25%
String copy (Compiler) 1022.7±83.06ns 984.2±75.18ns -3.76%
String copy (Execution) 5.8±0.45µs 5.9±0.44µs +1.72%
String copy (Parser) 6.0±0.64µs 6.2±0.56µs +3.33%
Symbols (Compiler) 764.9±56.79ns 759.6±51.13ns -0.69%
Symbols (Execution) 5.7±0.44µs 5.4±0.29µs -5.26%
Symbols (Parser) 4.5±0.37µs 4.3±0.27µs -4.44%

@Razican
Copy link
Member Author

Razican commented Feb 6, 2022

I'm actually pretty surprised that the benchmark are not clearly showing improvements, even though there might be some small ones. There is also one benchmark that shows a 18% worsening, which is worrying me. Maybe this is just due to the GitHub Actions uncertainty (no dedicated processing power, for instance).

We should probably try to benchmark things locally or in a dedicated-core virtual server.

@jasonwilliams
Copy link
Member

@Razican have you tried running the profiler and looking at before and after? That may give you a deeper insight into what is going on.

https://github.com/boa-dev/boa/blob/main/docs/profiling.md

@Razican
Copy link
Member Author

Razican commented Feb 6, 2022

@Razican have you tried running the profiler and looking at before and after? That may give you a deeper insight into what is going on.

https://github.com/boa-dev/boa/blob/main/docs/profiling.md

I ran the profiler locally and didn't see much difference. Then I ran benchmarks, and I could clearly see a consistent 2-6% improvement in the parser and a consistent and clear 1-2% improvement in the execution. The compiler was having a 0-1% improvement, but it was not very clear.

I also checked this "Array creation (Execution)" benchmark and got a 1.8% improvement locally, so that 18% worsening is definitely not real.

boa_wasm/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Member

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confused about the change in boa_wasm/Cargo.toml, the rest looks fine.

@github-actions
Copy link

github-actions bot commented Feb 6, 2022

Benchmark for ed38040

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 408.2±0.83ns 355.6±0.60ns -12.89%
Arithmetic operations (Execution) 2.0±0.00µs 1957.5±2.60ns -2.12%
Arithmetic operations (Parser) 5.8±0.02µs 5.6±0.00µs -3.45%
Array access (Compiler) 822.4±4.61ns 833.4±2.30ns +1.34%
Array access (Execution) 10.5±0.04µs 10.5±0.06µs 0.00%
Array access (Parser) 12.3±0.02µs 12.1±0.05µs -1.63%
Array creation (Compiler) 1179.8±3.47ns 1165.0±3.50ns -1.25%
Array creation (Execution) 3.1±0.01ms 3.3±0.01ms +6.45%
Array creation (Parser) 13.7±0.01µs 13.5±0.03µs -1.46%
Array pop (Compiler) 2.5±0.01µs 2.8±0.01µs +12.00%
Array pop (Execution) 1308.6±4.25µs 1371.8±5.58µs +4.83%
Array pop (Parser) 143.5±0.16µs 137.8±0.08µs -3.97%
Boolean Object Access (Compiler) 688.5±1.11ns 690.7±1.23ns +0.32%
Boolean Object Access (Execution) 7.0±0.02µs 6.9±0.02µs -1.43%
Boolean Object Access (Parser) 14.5±0.03µs 12.5±0.03µs -13.79%
Clean js (Compiler) 2.2±0.01µs 2.2±0.00µs 0.00%
Clean js (Execution) 1492.8±12.83µs 1481.5±17.35µs -0.76%
Clean js (Parser) 29.3±0.03µs 29.0±0.04µs -1.02%
Create Realm 339.9±3.64ns 340.6±4.89ns +0.21%
Dynamic Object Property Access (Compiler) 1169.3±3.56ns 1161.0±9.19ns -0.71%
Dynamic Object Property Access (Execution) 7.0±0.02µs 6.8±0.03µs -2.86%
Dynamic Object Property Access (Parser) 10.8±0.02µs 9.6±0.05µs -11.11%
Fibonacci (Compiler) 1509.0±4.07ns 1473.4±3.39ns -2.36%
Fibonacci (Execution) 2.8±0.00ms 2.8±0.00ms 0.00%
Fibonacci (Parser) 16.5±0.04µs 16.2±0.02µs -1.82%
For loop (Compiler) 1288.5±2.76ns 1294.6±3.04ns +0.47%
For loop (Execution) 44.5±0.16µs 43.9±0.16µs -1.35%
For loop (Parser) 14.2±0.03µs 13.9±0.04µs -2.11%
Mini js (Compiler) 2.2±0.01µs 2.1±0.00µs -4.55%
Mini js (Execution) 1373.0±6.94µs 1372.7±7.19µs -0.02%
Mini js (Parser) 25.8±0.07µs 22.5±0.03µs -12.79%
Number Object Access (Compiler) 648.0±1.30ns 648.5±1.03ns +0.08%
Number Object Access (Execution) 4.8±0.01µs 5.4±0.01µs +12.50%
Number Object Access (Parser) 11.4±0.02µs 11.2±0.02µs -1.75%
Object Creation (Compiler) 963.4±3.16ns 963.7±7.23ns +0.03%
Object Creation (Execution) 6.4±0.03µs 6.2±0.03µs -3.13%
Object Creation (Parser) 9.4±0.01µs 9.4±0.02µs 0.00%
RegExp (Compiler) 1172.1±5.38ns 1166.4±6.43ns -0.49%
RegExp (Execution) 13.3±0.07µs 12.5±0.03µs -6.02%
RegExp (Parser) 10.3±0.02µs 10.3±0.03µs 0.00%
RegExp Creation (Compiler) 1056.6±2.20ns 901.1±2.83ns -14.72%
RegExp Creation (Execution) 10.1±0.06µs 9.4±0.05µs -6.93%
RegExp Creation (Parser) 8.6±0.02µs 8.6±0.02µs 0.00%
RegExp Literal (Compiler) 1145.3±2.09ns 1156.9±5.17ns +1.01%
RegExp Literal (Execution) 13.4±0.05µs 12.6±0.03µs -5.97%
RegExp Literal (Parser) 8.2±0.01µs 8.3±0.01µs +1.22%
RegExp Literal Creation (Compiler) 1043.0±3.07ns 1031.2±2.78ns -1.13%
RegExp Literal Creation (Execution) 10.1±0.05µs 9.4±0.04µs -6.93%
RegExp Literal Creation (Parser) 6.5±0.01µs 6.6±0.05µs +1.54%
Static Object Property Access (Compiler) 981.7±2.67ns 974.2±3.29ns -0.76%
Static Object Property Access (Execution) 6.6±0.03µs 6.5±0.04µs -1.52%
Static Object Property Access (Parser) 10.1±0.01µs 10.0±0.03µs -0.99%
String Object Access (Compiler) 1044.7±6.62ns 1061.0±11.17ns +1.56%
String Object Access (Execution) 8.8±0.03µs 8.7±0.03µs -1.14%
String Object Access (Parser) 14.1±0.01µs 13.9±0.04µs -1.42%
String comparison (Compiler) 1334.1±4.20ns 1285.7±10.41ns -3.63%
String comparison (Execution) 7.3±0.03µs 7.2±0.03µs -1.37%
String comparison (Parser) 11.1±0.02µs 10.8±0.03µs -2.70%
String concatenation (Compiler) 945.6±1.83ns 1055.4±2.23ns +11.61%
String concatenation (Execution) 6.2±0.04µs 6.1±0.01µs -1.61%
String concatenation (Parser) 7.7±0.02µs 7.5±0.03µs -2.60%
String copy (Compiler) 895.0±1.71ns 773.6±2.44ns -13.56%
String copy (Execution) 5.4±0.02µs 5.2±0.02µs -3.70%
String copy (Parser) 5.7±0.01µs 5.6±0.02µs -1.75%
Symbols (Compiler) 575.1±1.47ns 657.8±1.85ns +14.38%
Symbols (Execution) 5.2±0.01µs 5.0±0.02µs -3.85%
Symbols (Parser) 4.4±0.01µs 4.4±0.01µs 0.00%

@github-actions
Copy link

github-actions bot commented Feb 6, 2022

Benchmark for 004d648

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 402.5±0.59ns 424.1±1.98ns +5.37%
Arithmetic operations (Execution) 1982.5±2.60ns 2.6±0.00µs +31.15%
Arithmetic operations (Parser) 5.8±0.00µs 5.7±0.01µs -1.72%
Array access (Compiler) 829.6±1.88ns 893.0±5.95ns +7.64%
Array access (Execution) 10.3±0.05µs 11.1±0.02µs +7.77%
Array access (Parser) 12.2±0.01µs 12.4±0.03µs +1.64%
Array creation (Compiler) 1187.5±3.75ns 1248.0±6.06ns +5.09%
Array creation (Execution) 3.1±0.01ms 3.4±0.03ms +9.68%
Array creation (Parser) 13.7±0.02µs 13.8±0.02µs +0.73%
Array pop (Compiler) 2.8±0.01µs 2.9±0.01µs +3.57%
Array pop (Execution) 1307.8±4.70µs 1413.1±12.04µs +8.05%
Array pop (Parser) 142.6±0.13µs 139.2±0.51µs -2.38%
Boolean Object Access (Compiler) 685.3±1.12ns 743.5±3.19ns +8.49%
Boolean Object Access (Execution) 6.9±0.02µs 7.7±0.01µs +11.59%
Boolean Object Access (Parser) 14.5±0.03µs 14.6±0.04µs +0.69%
Clean js (Compiler) 2.3±0.01µs 2.3±0.01µs 0.00%
Clean js (Execution) 1460.8±11.82µs 1624.9±16.19µs +11.23%
Clean js (Parser) 29.5±0.02µs 29.5±0.04µs 0.00%
Create Realm 336.6±0.28ns 347.7±0.39ns +3.30%
Dynamic Object Property Access (Compiler) 1169.9±4.11ns 1273.2±3.55ns +8.83%
Dynamic Object Property Access (Execution) 6.8±0.04µs 7.4±0.02µs +8.82%
Dynamic Object Property Access (Parser) 10.8±0.02µs 11.1±0.03µs +2.78%
Fibonacci (Compiler) 1498.9±6.97ns 1582.7±7.43ns +5.59%
Fibonacci (Execution) 2.7±0.01ms 2.9±0.04ms +7.41%
Fibonacci (Parser) 16.4±0.02µs 16.7±0.04µs +1.83%
For loop (Compiler) 1281.5±3.80ns 1378.9±4.14ns +7.60%
For loop (Execution) 43.7±0.15µs 51.6±1.31µs +18.08%
For loop (Parser) 14.1±0.01µs 14.3±0.18µs +1.42%
Mini js (Compiler) 2.2±0.03µs 2.3±0.01µs +4.55%
Mini js (Execution) 1347.1±45.52µs 1534.1±29.58µs +13.88%
Mini js (Parser) 25.8±0.03µs 26.1±0.03µs +1.16%
Number Object Access (Compiler) 641.6±1.39ns 698.8±1.49ns +8.92%
Number Object Access (Execution) 5.4±0.02µs 6.3±0.10µs +16.67%
Number Object Access (Parser) 11.3±0.01µs 11.4±0.03µs +0.88%
Object Creation (Compiler) 975.4±3.12ns 1043.0±2.90ns +6.93%
Object Creation (Execution) 6.2±0.02µs 6.7±0.03µs +8.06%
Object Creation (Parser) 9.4±0.02µs 9.6±0.03µs +2.13%
RegExp (Compiler) 1165.0±3.93ns 1240.0±9.03ns +6.44%
RegExp (Execution) 13.0±0.05µs 13.3±0.04µs +2.31%
RegExp (Parser) 10.3±0.02µs 10.5±0.03µs +1.94%
RegExp Creation (Compiler) 1041.3±3.36ns 1108.7±4.73ns +6.47%
RegExp Creation (Execution) 9.8±0.05µs 9.9±0.05µs +1.02%
RegExp Creation (Parser) 8.6±0.02µs 8.8±0.03µs +2.33%
RegExp Literal (Compiler) 1158.0±3.53ns 1236.0±6.54ns +6.74%
RegExp Literal (Execution) 12.9±0.03µs 13.3±0.03µs +3.10%
RegExp Literal (Parser) 8.3±0.01µs 8.5±0.10µs +2.41%
RegExp Literal Creation (Compiler) 1046.1±2.92ns 1122.2±2.42ns +7.27%
RegExp Literal Creation (Execution) 9.9±0.06µs 10.0±0.05µs +1.01%
RegExp Literal Creation (Parser) 6.5±0.01µs 6.7±0.03µs +3.08%
Static Object Property Access (Compiler) 992.3±5.91ns 1065.0±2.78ns +7.33%
Static Object Property Access (Execution) 6.4±0.02µs 6.9±0.03µs +7.81%
Static Object Property Access (Parser) 10.1±0.01µs 10.3±0.02µs +1.98%
String Object Access (Compiler) 1029.0±4.11ns 1137.8±6.93ns +10.57%
String Object Access (Execution) 8.7±0.01µs 9.7±0.04µs +11.49%
String Object Access (Parser) 14.2±0.02µs 14.2±0.01µs 0.00%
String comparison (Compiler) 1317.1±2.80ns 1379.7±3.04ns +4.75%
String comparison (Execution) 7.2±0.02µs 7.7±0.04µs +6.94%
String comparison (Parser) 11.1±0.02µs 11.3±0.07µs +1.80%
String concatenation (Compiler) 1072.7±2.64ns 1152.3±3.38ns +7.42%
String concatenation (Execution) 6.1±0.01µs 6.6±0.03µs +8.20%
String concatenation (Parser) 7.6±0.04µs 7.8±0.05µs +2.63%
String copy (Compiler) 887.0±2.64ns 979.1±6.04ns +10.38%
String copy (Execution) 5.2±0.01µs 5.7±0.02µs +9.62%
String copy (Parser) 5.7±0.01µs 5.9±0.02µs +3.51%
Symbols (Compiler) 647.8±1.95ns 698.0±1.27ns +7.75%
Symbols (Execution) 5.0±0.02µs 5.3±0.01µs +6.00%
Symbols (Parser) 4.4±0.01µs 4.4±0.01µs 0.00%

@github-actions
Copy link

github-actions bot commented Feb 7, 2022

Benchmark for 4e3b45b

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 360.1±2.08ns 348.7±1.05ns -3.17%
Arithmetic operations (Execution) 1936.7±2.15ns 1759.8±1.60ns -9.13%
Arithmetic operations (Parser) 5.8±0.02µs 4.9±0.01µs -15.52%
Array access (Compiler) 725.3±1.76ns 726.0±2.67ns +0.10%
Array access (Execution) 9.2±0.04µs 9.1±0.08µs -1.09%
Array access (Parser) 10.7±0.01µs 10.5±0.02µs -1.87%
Array creation (Compiler) 1028.7±2.08ns 1028.4±1.93ns -0.03%
Array creation (Execution) 2.8±0.02ms 2.9±0.01ms +3.57%
Array creation (Parser) 12.0±0.01µs 11.8±0.03µs -1.67%
Array pop (Compiler) 2.8±0.01µs 2.4±0.00µs -14.29%
Array pop (Execution) 1170.6±3.81µs 1198.4±6.37µs +2.37%
Array pop (Parser) 124.3±0.17µs 121.4±0.10µs -2.33%
Boolean Object Access (Compiler) 604.9±1.97ns 600.7±1.85ns -0.69%
Boolean Object Access (Execution) 6.7±0.01µs 6.1±0.02µs -8.96%
Boolean Object Access (Parser) 13.4±0.84µs 12.4±0.01µs -7.46%
Clean js (Compiler) 1930.9±7.13ns 1919.2±5.59ns -0.61%
Clean js (Execution) 1270.4±8.70µs 1307.8±11.60µs +2.94%
Clean js (Parser) 29.3±0.03µs 25.2±0.02µs -13.99%
Create Realm 318.3±19.49ns 295.4±0.42ns -7.19%
Dynamic Object Property Access (Compiler) 1149.9±2.46ns 1016.0±4.37ns -11.64%
Dynamic Object Property Access (Execution) 6.8±0.03µs 6.0±0.03µs -11.76%
Dynamic Object Property Access (Parser) 9.6±0.02µs 9.4±0.02µs -2.08%
Fibonacci (Compiler) 1316.8±3.68ns 1269.7±3.22ns -3.58%
Fibonacci (Execution) 2.4±0.01ms 2.4±0.00ms 0.00%
Fibonacci (Parser) 14.5±0.02µs 14.2±0.02µs -2.07%
For loop (Compiler) 1146.0±2.93ns 1296.3±228.49ns +13.12%
For loop (Execution) 42.8±0.14µs 38.5±0.31µs -10.05%
For loop (Parser) 12.4±0.02µs 12.2±0.08µs -1.61%
Mini js (Compiler) 1941.5±7.54ns 2.2±0.01µs +13.31%
Mini js (Execution) 1176.9±7.88µs 1210.1±6.13µs +2.82%
Mini js (Parser) 25.6±0.04µs 22.2±0.02µs -13.28%
Number Object Access (Compiler) 648.1±1.42ns 573.3±1.08ns -11.54%
Number Object Access (Execution) 4.7±0.02µs 4.8±0.01µs +2.13%
Number Object Access (Parser) 10.0±0.01µs 9.8±0.05µs -2.00%
Object Creation (Compiler) 847.8±2.76ns 842.5±4.13ns -0.63%
Object Creation (Execution) 5.4±0.01µs 5.4±0.01µs 0.00%
Object Creation (Parser) 8.3±0.03µs 8.1±0.01µs -2.41%
RegExp (Compiler) 1022.4±5.17ns 1006.2±4.25ns -1.58%
RegExp (Execution) 11.4±0.02µs 11.1±0.04µs -2.63%
RegExp (Parser) 9.1±0.01µs 9.0±0.01µs -1.10%
RegExp Creation (Compiler) 1029.0±3.12ns 906.7±3.28ns -11.89%
RegExp Creation (Execution) 9.8±0.06µs 8.3±0.03µs -15.31%
RegExp Creation (Parser) 7.6±0.02µs 7.5±0.01µs -1.32%
RegExp Literal (Compiler) 1142.2±2.07ns 1005.3±6.53ns -11.99%
RegExp Literal (Execution) 11.4±0.04µs 11.1±0.03µs -2.63%
RegExp Literal (Parser) 7.3±0.01µs 7.2±0.01µs -1.37%
RegExp Literal Creation (Compiler) 1044.7±2.76ns 905.6±4.06ns -13.31%
RegExp Literal Creation (Execution) 9.8±0.05µs 8.3±0.03µs -15.31%
RegExp Literal Creation (Parser) 5.7±0.01µs 5.6±0.01µs -1.75%
Static Object Property Access (Compiler) 989.8±3.90ns 854.9±2.52ns -13.63%
Static Object Property Access (Execution) 6.4±0.04µs 6.4±0.02µs 0.00%
Static Object Property Access (Parser) 8.8±0.02µs 8.8±0.03µs 0.00%
String Object Access (Compiler) 916.0±2.43ns 903.9±5.15ns -1.32%
String Object Access (Execution) 8.6±0.02µs 7.6±0.01µs -11.63%
String Object Access (Parser) 14.1±0.02µs 12.3±0.02µs -12.77%
String comparison (Compiler) 1138.1±7.52ns 1119.7±2.04ns -1.62%
String comparison (Execution) 7.2±0.03µs 6.4±0.02µs -11.11%
String comparison (Parser) 9.8±0.06µs 9.6±0.01µs -2.04%
String concatenation (Compiler) 934.0±2.26ns 937.2±3.92ns +0.34%
String concatenation (Execution) 6.2±0.07µs 5.4±0.01µs -12.90%
String concatenation (Parser) 6.8±0.01µs 6.5±0.02µs -4.41%
String copy (Compiler) 774.4±2.24ns 776.9±2.08ns +0.32%
String copy (Execution) 5.3±0.03µs 4.6±0.03µs -13.21%
String copy (Parser) 5.0±0.02µs 4.9±0.01µs -2.00%
Symbols (Compiler) 568.8±0.89ns 598.6±35.59ns +5.24%
Symbols (Execution) 4.4±0.01µs 4.4±0.01µs 0.00%
Symbols (Parser) 4.4±0.01µs 3.8±0.02µs -13.64%

@HalidOdat
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Feb 7, 2022
This PR boxes the `Try` and `TaggedTemplate` nodes reducing the size of the `Node` structure from 88 to 56 bytes. This should improve performance in most cases, by adding another indirection with code with `try` and templates.
@bors
Copy link

bors bot commented Feb 7, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Reduced the size of AST nodes [Merged by Bors] - Reduced the size of AST nodes Feb 7, 2022
@bors bors bot closed this Feb 7, 2022
@bors bors bot deleted the node_optimization branch February 7, 2022 23:27
@RageKnify RageKnify added the Internal Category for changelog label Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast Issue surrounding the abstract syntax tree Internal Category for changelog performance Performance related changes and issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants