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

Direct array length access #2796

Merged
merged 1 commit into from
May 5, 2023
Merged

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Apr 9, 2023

Depends on #2723

This PR utilizes the change done in #2723 on how we store properties on a continues indexed array, this makes the positions of properties such as "length" predefined on an array, because it is constructed from an ObjectTemplate.

This can make access on such properties just an index lookup into an array, speeding up execution of common operations like LengthOfArrayLike.

Pointing to #2723 for easier review, once #2723 is merged I will rebase and point to main :)

@HalidOdat HalidOdat added performance Performance related changes and issues execution Issues or PRs related to code execution run-benchmark Label used to run banchmarks on PRs labels Apr 9, 2023
@github-actions
Copy link

github-actions bot commented Apr 9, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,601 94,601 0
Passed 73,298 73,298 0
Ignored 17,540 17,540 0
Failed 3,763 3,763 0
Panics 0 0 0
Conformance 77.48% 77.48% 0.00%

@codecov
Copy link

codecov bot commented Apr 9, 2023

Codecov Report

Merging #2796 (5366f4a) into main (e3d2056) will increase coverage by 0.03%.
The diff coverage is 94.28%.

❗ Current head 5366f4a differs from pull request most recent head 464e2b9. Consider uploading reports for the commit 464e2b9 to get more accurate results

@@            Coverage Diff             @@
##             main    #2796      +/-   ##
==========================================
+ Coverage   51.90%   51.94%   +0.03%     
==========================================
  Files         428      428              
  Lines       43113    43134      +21     
==========================================
+ Hits        22378    22406      +28     
+ Misses      20735    20728       -7     
Impacted Files Coverage Δ
boa_engine/src/builtins/array/mod.rs 76.97% <91.66%> (+0.49%) ⬆️
boa_engine/src/object/operations.rs 49.59% <100.00%> (+0.70%) ⬆️
...a_engine/src/object/shape/shared_shape/template.rs 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@HalidOdat HalidOdat marked this pull request as ready for review April 9, 2023 19:20
@github-actions
Copy link

github-actions bot commented Apr 9, 2023

Benchmark for d2cb63a

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 560.9±1.06ns 563.9±202.35ns +0.53%
Arithmetic operations (Execution) 475.2±0.25ns 475.0±5.54ns -0.04%
Arithmetic operations (Parser) 7.4±0.01µs 7.4±0.05µs 0.00%
Array access (Compiler) 1659.1±3.08ns 1761.9±687.65ns +6.20%
Array access (Execution) 7.6±0.02µs 5.3±1.58µs -30.26%
Array access (Parser) 16.0±0.03µs 16.1±0.03µs +0.63%
Array creation (Compiler) 2.5±0.01µs 2.6±1.14µs +4.00%
Array creation (Execution) 1097.7±2.26µs 1196.3±168.70µs +8.98%
Array creation (Parser) 18.9±0.05µs 19.2±0.03µs +1.59%
Array pop (Compiler) 4.0±0.01µs 4.4±1.55µs +10.00%
Array pop (Execution) 644.4±0.87µs 460.7±64.84µs -28.51%
Array pop (Parser) 163.2±0.39µs 166.1±0.48µs +1.78%
Boolean Object Access (Compiler) 1178.5±2.53ns 1254.7±753.54ns +6.47%
Boolean Object Access (Execution) 4.0±0.01µs 4.8±1.41µs +20.00%
Boolean Object Access (Parser) 19.1±0.02µs 19.2±0.10µs +0.52%
Clean js (Compiler) 5.0±0.01µs 5.8±2.14µs +16.00%
Clean js (Execution) 625.6±2.12µs 662.8±133.02µs +5.95%
Clean js (Parser) 39.8±0.08µs 40.2±0.10µs +1.01%
Create Realm 413.2±5.08µs 430.4±413.73µs +4.16%
Dynamic Object Property Access (Compiler) 1957.5±3.43ns 2.2±1.17µs +12.39%
Dynamic Object Property Access (Execution) 4.7±0.01µs 3.2±1.43µs -31.91%
Dynamic Object Property Access (Parser) 14.3±0.03µs 14.5±0.07µs +1.40%
Fibonacci (Compiler) 3.1±0.00µs 3.4±1.82µs +9.68%
Fibonacci (Execution) 1057.8±1.03µs 719.1±229.38µs -32.02%
Fibonacci (Parser) 22.4±0.05µs 22.6±0.02µs +0.89%
For loop (Compiler) 2.8±0.00µs 3.0±1.23µs +7.14%
For loop (Execution) 16.6±0.03µs 14.7±5.33µs -11.45%
For loop (Parser) 19.3±0.04µs 19.7±0.04µs +2.07%
Mini js (Compiler) 4.4±0.00µs 5.3±2.28µs +20.45%
Mini js (Execution) 577.1±2.42µs 608.8±169.79µs +5.49%
Mini js (Parser) 34.8±0.07µs 35.1±0.07µs +0.86%
Number Object Access (Compiler) 1094.1±3.22ns 1130.6±356.54ns +3.34%
Number Object Access (Execution) 3.1±0.00µs 3.9±1.44µs +25.81%
Number Object Access (Parser) 14.8±0.03µs 14.8±0.03µs 0.00%
Object Creation (Compiler) 1780.4±2.97ns 1883.2±800.68ns +5.77%
Object Creation (Execution) 4.4±0.01µs 2.7±1.43µs -38.64%
Object Creation (Parser) 12.7±0.03µs 12.7±0.03µs 0.00%
RegExp (Compiler) 2.0±0.00µs 2.2±1.08µs +10.00%
RegExp (Execution) 12.1±0.04µs 11.1±2.48µs -8.26%
RegExp (Parser) 13.5±0.07µs 13.7±0.02µs +1.48%
RegExp Creation (Compiler) 1761.5±2.58ns 1914.6±819.81ns +8.69%
RegExp Creation (Execution) 8.5±0.02µs 7.5±1.92µs -11.76%
RegExp Creation (Parser) 11.7±0.03µs 11.6±0.03µs -0.85%
RegExp Literal (Compiler) 2.0±0.00µs 2.2±1.02µs +10.00%
RegExp Literal (Execution) 12.1±0.05µs 11.2±2.52µs -7.44%
RegExp Literal (Parser) 14.5±0.06µs 14.9±0.02µs +2.76%
RegExp Literal Creation (Compiler) 1768.7±7.05ns 1897.4±779.88ns +7.28%
RegExp Literal Creation (Execution) 8.5±0.02µs 7.9±4.55µs -7.06%
RegExp Literal Creation (Parser) 12.4±0.02µs 12.6±0.02µs +1.61%
Static Object Property Access (Compiler) 1808.4±2.65ns 1918.1±931.69ns +6.07%
Static Object Property Access (Execution) 4.6±0.01µs 2.9±1.20µs -36.96%
Static Object Property Access (Parser) 13.6±0.03µs 13.7±0.03µs +0.74%
String Object Access (Compiler) 1509.3±1.89ns 1668.1±739.84ns +10.52%
String Object Access (Execution) 5.6±0.01µs 7.0±1.91µs +25.00%
String Object Access (Parser) 19.0±0.02µs 18.7±0.02µs -1.58%
String comparison (Compiler) 2.6±0.00µs 3.1±1.18µs +19.23%
String comparison (Execution) 4.0±0.02µs 2.1±0.88µs -47.50%
String comparison (Parser) 15.2±0.02µs 15.5±0.02µs +1.97%
String concatenation (Compiler) 2.0±0.00µs 2.4±1.01µs +20.00%
String concatenation (Execution) 3.7±0.01µs 1982.4±942.43ns -46.42%
String concatenation (Parser) 10.4±0.02µs 10.6±0.01µs +1.92%
String copy (Compiler) 1676.8±2.91ns 1776.9±708.75ns +5.97%
String copy (Execution) 3.4±0.01µs 1616.3±629.01ns -52.46%
String copy (Parser) 8.0±0.01µs 8.1±0.02µs +1.25%
Symbols (Compiler) 1253.5±3.03ns 1379.4±1012.23ns +10.04%
Symbols (Execution) 3.5±0.01µs 1835.8±832.94ns -47.55%
Symbols (Parser) 6.3±0.02µs 6.4±0.04µs +1.59%

@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from 8904e2b to 896dc49 Compare April 11, 2023 17:02
@HalidOdat HalidOdat changed the base branch from main to optimization/object-shapes April 11, 2023 17:04
@HalidOdat HalidOdat force-pushed the optimization/object-shapes branch from a406a1e to 1f90e70 Compare April 11, 2023 20:58
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch 2 times, most recently from 619860c to d9a712c Compare April 11, 2023 21:05
@HalidOdat HalidOdat force-pushed the optimization/object-shapes branch 3 times, most recently from bf6681f to 715ef73 Compare April 17, 2023 03:34
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from d9a712c to ec570db Compare April 17, 2023 03:42
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

Looks good!!

@HalidOdat HalidOdat force-pushed the optimization/object-shapes branch from 715ef73 to be6ad76 Compare April 21, 2023 19:29
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from ec570db to a6bdd5f Compare April 21, 2023 19:32
@HalidOdat HalidOdat mentioned this pull request Apr 23, 2023
28 tasks
@HalidOdat HalidOdat force-pushed the optimization/object-shapes branch from be6ad76 to bd062f8 Compare April 24, 2023 06:10
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from a6bdd5f to a9f74c2 Compare April 24, 2023 06:17
@HalidOdat HalidOdat changed the base branch from optimization/object-shapes to main April 25, 2023 05:52
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from a9f74c2 to 59e9b9d Compare April 25, 2023 06:30
@github-actions
Copy link

Benchmark for 6901e42

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 563.5±23.66ns 632.3±972.36ns +12.21%
Arithmetic operations (Execution) 468.0±1.73ns 476.0±0.33ns +1.71%
Arithmetic operations (Parser) 7.6±0.06µs 7.4±0.11µs -2.63%
Array access (Compiler) 1736.9±40.69ns 1818.7±1759.94ns +4.71%
Array access (Execution) 7.6±0.02µs 7.3±12.36µs -3.95%
Array access (Parser) 14.9±0.09µs 14.7±0.03µs -1.34%
Array creation (Compiler) 2.5±0.01µs 2.9±4.14µs +16.00%
Array creation (Execution) 1097.5±2.54µs 1109.3±10.12µs +1.08%
Array creation (Parser) 18.3±0.13µs 17.4±0.05µs -4.92%
Array pop (Compiler) 4.0±0.02µs 5.6±14.07µs +40.00%
Array pop (Execution) 636.2±1.71µs 507.8±233.54µs -20.18%
Array pop (Parser) 161.9±0.23µs 163.0±0.13µs +0.68%
Boolean Object Access (Compiler) 1170.3±4.00ns 1205.6±817.88ns +3.02%
Boolean Object Access (Execution) 4.8±0.02µs 5.4±4.31µs +12.50%
Boolean Object Access (Parser) 16.9±0.52µs 16.4±0.02µs -2.96%
Clean js (Compiler) 5.1±0.02µs 5.8±6.25µs +13.73%
Clean js (Execution) 755.0±4.55µs 780.6±340.00µs +3.39%
Clean js (Parser) 38.2±0.26µs 37.4±0.07µs -2.09%
Create Realm 504.6±2.50µs 535.0±1407.18µs +6.02%
Dynamic Object Property Access (Compiler) 2.0±0.01µs 2.2±3.28µs +10.00%
Dynamic Object Property Access (Execution) 4.8±0.01µs 4.2±4.94µs -12.50%
Dynamic Object Property Access (Parser) 13.3±0.13µs 13.3±0.04µs 0.00%
Fibonacci (Compiler) 3.1±0.01µs 4.0±5.89µs +29.03%
Fibonacci (Execution) 1165.7±5.84µs 917.6±888.77µs -21.28%
Fibonacci (Parser) 21.2±0.12µs 20.6±0.03µs -2.83%
For loop (Compiler) 2.8±0.01µs 3.2±2.80µs +14.29%
For loop (Execution) 16.3±0.06µs 19.4±27.17µs +19.02%
For loop (Parser) 19.4±0.07µs 18.6±0.05µs -4.12%
Mini js (Compiler) 4.4±0.02µs 5.3±5.08µs +20.45%
Mini js (Execution) 696.7±2.86µs 693.8±7.30µs -0.42%
Mini js (Parser) 33.2±0.15µs 32.7±0.06µs -1.51%
Number Object Access (Compiler) 1087.4±2.37ns 1438.2±2445.35ns +32.26%
Number Object Access (Execution) 3.8±0.01µs 4.1±3.12µs +7.89%
Number Object Access (Parser) 13.1±0.05µs 13.1±0.02µs 0.00%
Object Creation (Compiler) 1791.2±4.66ns 2.1±3.58µs +17.24%
Object Creation (Execution) 4.6±0.17µs 3.7±3.97µs -19.57%
Object Creation (Parser) 11.6±0.10µs 11.5±0.03µs -0.86%
RegExp (Compiler) 2.0±0.01µs 2.1±2.28µs +5.00%
RegExp (Execution) 12.5±0.03µs 12.6±8.93µs +0.80%
RegExp (Parser) 12.5±0.11µs 12.4±0.07µs -0.80%
RegExp Creation (Compiler) 1799.7±10.38ns 1984.1±2729.65ns +10.25%
RegExp Creation (Execution) 8.8±0.02µs 8.7±8.98µs -1.14%
RegExp Creation (Parser) 10.4±0.06µs 10.3±0.07µs -0.96%
RegExp Literal (Compiler) 2.0±0.00µs 2.1±2.24µs +5.00%
RegExp Literal (Execution) 12.5±0.04µs 12.9±12.00µs +3.20%
RegExp Literal (Parser) 13.7±0.05µs 13.6±0.04µs -0.73%
RegExp Literal Creation (Compiler) 1799.4±5.03ns 2.3±4.78µs +27.82%
RegExp Literal Creation (Execution) 8.9±0.03µs 7.9±4.35µs -11.24%
RegExp Literal Creation (Parser) 11.6±0.02µs 11.7±0.25µs +0.86%
Static Object Property Access (Compiler) 1814.1±22.53ns 1904.8±2362.90ns +5.00%
Static Object Property Access (Execution) 4.7±0.01µs 4.2±6.10µs -10.64%
Static Object Property Access (Parser) 12.2±0.09µs 12.2±0.03µs 0.00%
String Object Access (Compiler) 1520.3±6.37ns 1980.8±3330.27ns +30.29%
String Object Access (Execution) 6.6±0.02µs 7.9±8.11µs +19.70%
String Object Access (Parser) 17.1±0.70µs 16.4±0.03µs -4.09%
String comparison (Compiler) 2.6±0.01µs 3.3±4.35µs +26.92%
String comparison (Execution) 4.2±0.01µs 2.9±3.04µs -30.95%
String comparison (Parser) 15.3±0.25µs 14.7±0.03µs -3.92%
String concatenation (Compiler) 2.1±0.01µs 2.6±2.73µs +23.81%
String concatenation (Execution) 3.9±0.01µs 3.3±6.00µs -15.38%
String concatenation (Parser) 10.4±0.15µs 10.0±0.01µs -3.85%
String copy (Compiler) 1680.5±4.08ns 1863.0±2400.24ns +10.86%
String copy (Execution) 3.7±0.01µs 2.7±3.82µs -27.03%
String copy (Parser) 7.8±0.08µs 7.6±0.02µs -2.56%
Symbols (Compiler) 1224.6±14.37ns 1317.1±1737.23ns +7.55%
Symbols (Execution) 3.9±0.02µs 2.9±3.83µs -25.64%
Symbols (Parser) 5.7±0.07µs 5.6±0.01µs -1.75%

@HalidOdat HalidOdat changed the base branch from main to optimization/object-shapes April 26, 2023 04:38
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from 59e9b9d to de7b959 Compare April 26, 2023 04:38
@bors bors bot changed the base branch from optimization/object-shapes to main April 26, 2023 05:42
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from de7b959 to f621507 Compare April 26, 2023 06:47
@github-actions
Copy link

Benchmark for 422ce0d

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 567.4±803.53ns 698.4±1057.38ns +23.09%
Arithmetic operations (Execution) 437.4±30.95ns 438.1±29.98ns +0.16%
Arithmetic operations (Parser) 6.5±0.39µs 6.4±0.45µs -1.54%
Array access (Compiler) 2.4±5.55µs 2.3±3.64µs -4.17%
Array access (Execution) 6.9±6.56µs 5.8±5.85µs -15.94%
Array access (Parser) 12.3±1.16µs 12.0±0.94µs -2.44%
Array creation (Compiler) 3.0±4.46µs 3.5±8.23µs +16.67%
Array creation (Execution) 943.1±1317.81µs 817.1±457.52µs -13.36%
Array creation (Parser) 14.7±0.79µs 14.5±0.85µs -1.36%
Array pop (Compiler) 4.8±4.56µs 5.2±4.56µs +8.33%
Array pop (Execution) 700.6±737.22µs 452.5±28.73µs -35.41%
Array pop (Parser) 138.7±7.30µs 139.8±8.79µs +0.79%
Boolean Object Access (Compiler) 1286.9±1594.58ns 1367.8±2099.84ns +6.29%
Boolean Object Access (Execution) 6.0±4.37µs 6.6±11.75µs +10.00%
Boolean Object Access (Parser) 14.1±0.88µs 13.7±0.65µs -2.84%
Clean js (Compiler) 6.1±8.61µs 7.2±13.48µs +18.03%
Clean js (Execution) 871.6±404.73µs 960.7±2211.98µs +10.22%
Clean js (Parser) 30.8±1.23µs 30.9±1.79µs +0.32%
Create Realm 623.6±1814.51µs 612.2±1754.69µs -1.83%
Dynamic Object Property Access (Compiler) 2.7±3.85µs 2.3±3.01µs -14.81%
Dynamic Object Property Access (Execution) 4.3±6.58µs 4.5±7.16µs +4.65%
Dynamic Object Property Access (Parser) 11.0±0.77µs 11.3±0.58µs +2.73%
Fibonacci (Compiler) 4.0±6.19µs 6.8±33.82µs +70.00%
Fibonacci (Execution) 974.1±1634.67µs 917.9±1000.68µs -5.77%
Fibonacci (Parser) 17.7±1.07µs 17.4±0.96µs -1.69%
For loop (Compiler) 3.2±4.04µs 3.1±4.27µs -3.13%
For loop (Execution) 19.8±31.09µs 23.5±46.41µs +18.69%
For loop (Parser) 15.9±1.05µs 16.0±0.96µs +0.63%
Mini js (Compiler) 6.0±8.96µs 5.8±9.33µs -3.33%
Mini js (Execution) 784.0±36.39µs 725.8±35.13µs -7.42%
Mini js (Parser) 28.1±1.92µs 27.6±1.68µs -1.78%
Number Object Access (Compiler) 1357.7±1488.15ns 1368.5±1831.88ns +0.80%
Number Object Access (Execution) 5.1±7.68µs 4.8±6.87µs -5.88%
Number Object Access (Parser) 11.6±0.92µs 11.1±0.65µs -4.31%
Object Creation (Compiler) 2.1±3.63µs 1790.4±2810.28ns -14.74%
Object Creation (Execution) 4.0±6.72µs 4.4±8.85µs +10.00%
Object Creation (Parser) 9.8±0.56µs 9.9±0.54µs +1.02%
RegExp (Compiler) 2.9±6.92µs 2.3±3.10µs -20.69%
RegExp (Execution) 12.8±13.70µs 13.0±12.97µs +1.56%
RegExp (Parser) 10.2±0.50µs 10.1±0.62µs -0.98%
RegExp Creation (Compiler) 10.0±78.53µs 1862.0±3291.26ns -81.38%
RegExp Creation (Execution) 7.6±5.37µs 9.4±14.08µs +23.68%
RegExp Creation (Parser) 8.5±0.58µs 8.9±0.71µs +4.71%
RegExp Literal (Compiler) 2.3±3.42µs 2.5±3.66µs +8.70%
RegExp Literal (Execution) 11.3±7.73µs 15.1±31.44µs +33.63%
RegExp Literal (Parser) 11.7±0.69µs 11.8±0.63µs +0.85%
RegExp Literal Creation (Compiler) 3.0±9.50µs 2.6±8.26µs -13.33%
RegExp Literal Creation (Execution) 8.3±7.97µs 8.8±8.08µs +6.02%
RegExp Literal Creation (Parser) 9.9±0.58µs 10.2±0.52µs +3.03%
Static Object Property Access (Compiler) 3.0±9.47µs 1888.8±2754.44ns -37.04%
Static Object Property Access (Execution) 4.2±6.11µs 4.2±6.47µs 0.00%
Static Object Property Access (Parser) 10.2±0.63µs 10.2±0.54µs 0.00%
String Object Access (Compiler) 1753.7±1810.83ns 1732.3±2311.12ns -1.22%
String Object Access (Execution) 7.4±6.92µs 7.2±5.95µs -2.70%
String Object Access (Parser) 14.0±1.01µs 14.4±1.16µs +2.86%
String comparison (Compiler) 3.5±4.58µs 3.1±3.59µs -11.43%
String comparison (Execution) 3.4±4.95µs 3.7±6.10µs +8.82%
String comparison (Parser) 12.6±0.79µs 12.5±0.65µs -0.79%
String concatenation (Compiler) 2.5±4.08µs 3.0±6.33µs +20.00%
String concatenation (Execution) 3.1±4.56µs 3.2±5.05µs +3.23%
String concatenation (Parser) 8.5±0.55µs 8.5±0.57µs 0.00%
String copy (Compiler) 2.3±5.17µs 1956.9±3147.71ns -14.92%
String copy (Execution) 3.0±5.03µs 3.2±5.95µs +6.67%
String copy (Parser) 6.2±0.41µs 6.0±0.32µs -3.23%
Symbols (Compiler) 1663.5±3576.69ns 1645.8±3310.16ns -1.06%
Symbols (Execution) 3.0±4.48µs 3.1±4.77µs +3.33%
Symbols (Parser) 4.4±0.29µs 4.4±0.26µs 0.00%

@github-actions
Copy link

Benchmark for 04240d3

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 653.2±1035.94ns 659.1±991.34ns +0.90%
Arithmetic operations (Execution) 453.7±1.20ns 453.1±0.29ns -0.13%
Arithmetic operations (Parser) 7.2±0.01µs 7.2±0.01µs 0.00%
Array access (Compiler) 2.3±5.18µs 2.2±4.38µs -4.35%
Array access (Execution) 7.0±6.59µs 6.1±6.00µs -12.86%
Array access (Parser) 14.0±0.35µs 13.8±0.02µs -1.43%
Array creation (Compiler) 3.2±4.97µs 3.1±4.12µs -3.13%
Array creation (Execution) 812.3±423.18µs 821.6±434.01µs +1.14%
Array creation (Parser) 16.6±0.03µs 16.7±0.02µs +0.60%
Array pop (Compiler) 5.1±4.92µs 4.9±4.53µs -3.92%
Array pop (Execution) 642.2±10.10µs 697.7±2510.24µs +8.64%
Array pop (Parser) 153.9±0.13µs 153.3±0.15µs -0.39%
Boolean Object Access (Compiler) 1784.7±5044.39ns 1388.5±1138.26ns -22.20%
Boolean Object Access (Execution) 6.6±10.01µs 6.0±5.51µs -9.09%
Boolean Object Access (Parser) 15.8±0.01µs 15.7±0.01µs -0.63%
Clean js (Compiler) 6.7±9.22µs 6.3±8.68µs -5.97%
Clean js (Execution) 905.9±302.74µs 828.9±431.51µs -8.50%
Clean js (Parser) 35.6±0.05µs 35.3±0.18µs -0.84%
Create Realm 598.0±1645.14µs 586.8±1606.98µs -1.87%
Dynamic Object Property Access (Compiler) 2.3±3.43µs 3.8±12.25µs +65.22%
Dynamic Object Property Access (Execution) 4.4±7.14µs 4.0±5.20µs -9.09%
Dynamic Object Property Access (Parser) 12.5±0.02µs 12.5±0.02µs 0.00%
Fibonacci (Compiler) 13.4±97.92µs 5.4±17.38µs -59.70%
Fibonacci (Execution) 940.5±1016.35µs 898.5±1189.56µs -4.47%
Fibonacci (Parser) 19.6±0.09µs 19.3±0.05µs -1.53%
For loop (Compiler) 3.1±4.26µs 3.1±4.23µs 0.00%
For loop (Execution) 22.6±48.06µs 20.1±27.35µs -11.06%
For loop (Parser) 17.6±0.03µs 17.7±0.33µs +0.57%
Mini js (Compiler) 5.9±7.55µs 6.5±9.57µs +10.17%
Mini js (Execution) 829.6±6.22µs 739.8±3.54µs -10.82%
Mini js (Parser) 31.5±0.15µs 31.4±0.03µs -0.32%
Number Object Access (Compiler) 1373.8±2463.02ns 1387.9±1474.00ns +1.03%
Number Object Access (Execution) 4.7±4.56µs 4.6±3.90µs -2.13%
Number Object Access (Parser) 12.6±0.01µs 12.6±0.01µs 0.00%
Object Creation (Compiler) 2.0±2.78µs 2.4±4.79µs +20.00%
Object Creation (Execution) 3.5±4.46µs 4.1±5.84µs +17.14%
Object Creation (Parser) 10.9±0.03µs 10.8±0.03µs -0.92%
RegExp (Compiler) 3.1±6.07µs 2.9±5.52µs -6.45%
RegExp (Execution) 13.9±21.90µs 13.2±13.97µs -5.04%
RegExp (Parser) 11.9±0.02µs 11.7±0.02µs -1.68%
RegExp Creation (Compiler) 2.1±3.33µs 2.6±7.23µs +23.81%
RegExp Creation (Execution) 8.5±6.62µs 7.9±5.54µs -7.06%
RegExp Creation (Parser) 9.8±0.02µs 9.9±0.06µs +1.02%
RegExp Literal (Compiler) 2.2±3.14µs 2.6±3.28µs +18.18%
RegExp Literal (Execution) 12.0±7.10µs 17.1±52.35µs +42.50%
RegExp Literal (Parser) 13.0±0.04µs 12.9±0.03µs -0.77%
RegExp Literal Creation (Compiler) 2.0±3.02µs 2.1±2.98µs +5.00%
RegExp Literal Creation (Execution) 8.6±8.05µs 8.6±8.08µs 0.00%
RegExp Literal Creation (Parser) 10.9±0.04µs 10.9±0.02µs 0.00%
Static Object Property Access (Compiler) 3.2±12.45µs 2.0±2.83µs -37.50%
Static Object Property Access (Execution) 4.2±5.73µs 4.4±6.95µs +4.76%
Static Object Property Access (Parser) 11.6±0.02µs 11.5±0.02µs -0.86%
String Object Access (Compiler) 2.1±4.80µs 2.3±5.12µs +9.52%
String Object Access (Execution) 7.8±5.22µs 8.5±9.98µs +8.97%
String Object Access (Parser) 15.6±0.01µs 15.5±0.02µs -0.64%
String comparison (Compiler) 3.4±4.25µs 3.5±4.32µs +2.94%
String comparison (Execution) 3.9±7.31µs 4.0±7.13µs +2.56%
String comparison (Parser) 13.7±0.02µs 13.9±0.02µs +1.46%
String concatenation (Compiler) 2.5±3.94µs 2.8±4.17µs +12.00%
String concatenation (Execution) 3.3±5.04µs 3.6±6.67µs +9.09%
String concatenation (Parser) 9.3±0.01µs 9.3±0.04µs 0.00%
String copy (Compiler) 4.2±20.78µs 2.3±4.94µs -45.24%
String copy (Execution) 2.9±4.12µs 2.9±4.11µs 0.00%
String copy (Parser) 7.0±0.02µs 6.9±0.02µs -1.43%
Symbols (Compiler) 1573.5±3253.46ns 1651.0±3234.43ns +4.93%
Symbols (Execution) 3.0±4.03µs 3.0±4.07µs 0.00%
Symbols (Parser) 5.2±0.01µs 5.1±0.01µs -1.92%

@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from 1254ba5 to 642e8c8 Compare April 28, 2023 19:43
@github-actions
Copy link

Benchmark for e01e1fc

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 651.6±856.90ns 760.3±1219.46ns +16.68%
Arithmetic operations (Execution) 551.0±0.32ns 562.6±0.50ns +2.11%
Arithmetic operations (Parser) 8.5±0.57µs 8.0±0.01µs -5.88%
Array access (Compiler) 2.2±3.50µs 2.2±4.00µs 0.00%
Array access (Execution) 8.5±9.64µs 7.7±9.87µs -9.41%
Array access (Parser) 14.9±0.04µs 14.8±0.10µs -0.67%
Array creation (Compiler) 3.2±4.47µs 4.2±11.19µs +31.25%
Array creation (Execution) 880.2±15.47µs 890.3±11.66µs +1.15%
Array creation (Parser) 18.1±0.03µs 18.0±0.04µs -0.55%
Array pop (Compiler) 5.9±4.73µs 7.5±19.52µs +27.12%
Array pop (Execution) 750.4±6.47µs 555.3±374.36µs -26.00%
Array pop (Parser) 171.2±0.34µs 169.8±0.41µs -0.82%
Boolean Object Access (Compiler) 1953.4±3904.84ns 1935.9±2539.70ns -0.90%
Boolean Object Access (Execution) 7.3±5.19µs 7.0±5.32µs -4.11%
Boolean Object Access (Parser) 17.1±0.03µs 16.9±0.03µs -1.17%
Clean js (Compiler) 6.9±8.30µs 7.5±7.71µs +8.70%
Clean js (Execution) 1096.3±602.81µs 917.0±20.04µs -16.36%
Clean js (Parser) 39.4±2.14µs 38.4±0.09µs -2.54%
Create Realm 702.1±1882.10µs 696.1±1847.80µs -0.85%
Dynamic Object Property Access (Compiler) 3.0±5.91µs 2.7±3.45µs -10.00%
Dynamic Object Property Access (Execution) 5.4±9.17µs 5.9±12.71µs +9.26%
Dynamic Object Property Access (Parser) 13.5±0.03µs 13.5±0.04µs 0.00%
Fibonacci (Compiler) 5.1±10.64µs 5.0±8.19µs -1.96%
Fibonacci (Execution) 1057.3±1223.83µs 1328.9±3233.21µs +25.69%
Fibonacci (Parser) 21.1±0.06µs 21.1±0.05µs 0.00%
For loop (Compiler) 4.5±8.30µs 4.2±6.34µs -6.67%
For loop (Execution) 22.8±28.26µs 24.9±45.27µs +9.21%
For loop (Parser) 19.3±0.03µs 19.4±0.06µs +0.52%
Mini js (Compiler) 6.6±7.66µs 6.8±7.21µs +3.03%
Mini js (Execution) 976.2±10.66µs 871.7±2.67µs -10.70%
Mini js (Parser) 33.7±0.06µs 33.9±0.09µs +0.59%
Number Object Access (Compiler) 1397.1±1108.74ns 1730.8±1408.40ns +23.89%
Number Object Access (Execution) 5.8±5.76µs 6.0±6.38µs +3.45%
Number Object Access (Parser) 13.7±0.02µs 13.7±0.07µs 0.00%
Object Creation (Compiler) 2.4±2.99µs 2.5±3.78µs +4.17%
Object Creation (Execution) 4.5±6.07µs 6.1±17.74µs +35.56%
Object Creation (Parser) 12.2±0.58µs 11.7±0.03µs -4.10%
RegExp (Compiler) 2.4±3.42µs 3.7±7.84µs +54.17%
RegExp (Execution) 14.4±10.04µs 14.4±11.06µs 0.00%
RegExp (Parser) 12.7±0.03µs 12.5±0.02µs -1.57%
RegExp Creation (Compiler) 2.5±4.34µs 2.5±3.71µs 0.00%
RegExp Creation (Execution) 11.7±10.67µs 9.8±8.32µs -16.24%
RegExp Creation (Parser) 10.6±0.06µs 10.5±0.02µs -0.94%
RegExp Literal (Compiler) 2.7±3.35µs 3.3±4.57µs +22.22%
RegExp Literal (Execution) 16.8±29.66µs 14.2±9.29µs -15.48%
RegExp Literal (Parser) 14.8±0.71µs 14.2±0.04µs -4.05%
RegExp Literal Creation (Compiler) 2.3±3.81µs 2.1±3.13µs -8.70%
RegExp Literal Creation (Execution) 10.9±16.40µs 11.4±22.02µs +4.59%
RegExp Literal Creation (Parser) 12.0±0.03µs 12.1±0.03µs +0.83%
Static Object Property Access (Compiler) 2.6±3.53µs 2.7±5.49µs +3.85%
Static Object Property Access (Execution) 4.5±5.53µs 6.2±17.37µs +37.78%
Static Object Property Access (Parser) 13.0±1.19µs 12.5±0.05µs -3.85%
String Object Access (Compiler) 2.1±2.60µs 2.1±1.96µs 0.00%
String Object Access (Execution) 8.6±5.67µs 9.3±11.61µs +8.14%
String Object Access (Parser) 17.1±0.04µs 17.0±0.02µs -0.58%
String comparison (Compiler) 4.3±6.96µs 4.1±7.22µs -4.65%
String comparison (Execution) 4.1±4.58µs 5.1±12.50µs +24.39%
String comparison (Parser) 15.0±0.02µs 15.1±0.02µs +0.67%
String concatenation (Compiler) 3.4±5.17µs 3.2±5.77µs -5.88%
String concatenation (Execution) 3.9±5.82µs 4.5±9.23µs +15.38%
String concatenation (Parser) 10.1±0.05µs 10.2±0.03µs +0.99%
String copy (Compiler) 3.0±6.12µs 3.0±7.55µs 0.00%
String copy (Execution) 3.8±6.65µs 3.9±7.27µs +2.63%
String copy (Parser) 7.5±0.02µs 7.4±0.02µs -1.33%
Symbols (Compiler) 1835.1±3993.13ns 2.1±4.18µs +14.44%
Symbols (Execution) 3.9±7.18µs 3.6±5.09µs -7.69%
Symbols (Parser) 5.5±0.07µs 5.5±0.02µs 0.00%

@raskad
Copy link
Member

raskad commented May 4, 2023

@HalidOdat did you already check some of the increased execution benches? E.g. String concatenation, String comparison, Static Object Property Access, Object Creation...

Just from the diff, I dont see how this could cause those large increases.

@HalidOdat
Copy link
Member Author

HalidOdat commented May 5, 2023

@HalidOdat did you already check some of the increased execution benches? E.g. String concatenation, String comparison, Static Object Property Access, Object Creation...

Just from the diff, I dont see how this could cause those large increases.

Ran the benchmarks and there was no registered regression, there was a ~28% improvment in Array Pop (Execution) which is what this PR targets (array internal length check of operations like pop, push, etc)

It seems like the faster boa becomes the less accurate the benchmarks becomes.

@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from 642e8c8 to bec37d1 Compare May 5, 2023 13:38
@github-actions
Copy link

github-actions bot commented May 5, 2023

Benchmark for 75d1c89

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 694.1±892.98ns 753.9±1092.56ns +8.62%
Arithmetic operations (Execution) 538.6±1.95ns 536.6±0.35ns -0.37%
Arithmetic operations (Parser) 8.0±0.02µs 8.0±0.01µs 0.00%
Array access (Compiler) 3.3±10.14µs 2.1±2.94µs -36.36%
Array access (Execution) 10.1±22.71µs 7.6±7.29µs -24.75%
Array access (Parser) 14.7±0.02µs 14.6±0.10µs -0.68%
Array creation (Compiler) 3.2±4.22µs 3.1±4.87µs -3.13%
Array creation (Execution) 954.5±803.91µs 901.7±464.44µs -5.53%
Array creation (Parser) 18.1±0.05µs 17.9±0.03µs -1.10%
Array pop (Compiler) 5.7±5.06µs 5.8±5.48µs +1.75%
Array pop (Execution) 799.5±368.80µs 552.0±300.88µs -30.96%
Array pop (Parser) 170.1±0.59µs 170.9±0.27µs +0.47%
Boolean Object Access (Compiler) 1595.1±1966.56ns 1368.9±1146.42ns -14.18%
Boolean Object Access (Execution) 7.8±5.32µs 8.1±5.74µs +3.85%
Boolean Object Access (Parser) 17.0±0.03µs 17.0±0.02µs 0.00%
Clean js (Compiler) 8.0±12.87µs 7.0±10.32µs -12.50%
Clean js (Execution) 1049.5±5.66µs 961.2±380.59µs -8.41%
Clean js (Parser) 38.3±0.06µs 37.9±0.08µs -1.04%
Create Realm 887.4±3637.16µs 880.6±3628.46µs -0.77%
Dynamic Object Property Access (Compiler) 2.7±3.91µs 2.8±3.58µs +3.70%
Dynamic Object Property Access (Execution) 4.9±5.63µs 5.6±8.28µs +14.29%
Dynamic Object Property Access (Parser) 13.2±0.18µs 13.3±0.04µs +0.76%
Fibonacci (Compiler) 4.1±4.14µs 4.1±4.25µs 0.00%
Fibonacci (Execution) 1582.4±5789.44µs 1160.5±1565.38µs -26.66%
Fibonacci (Parser) 21.1±0.04µs 21.3±0.07µs +0.95%
For loop (Compiler) 4.3±6.12µs 4.1±5.83µs -4.65%
For loop (Execution) 23.0±29.70µs 26.5±48.76µs +15.22%
For loop (Parser) 19.3±0.06µs 19.3±0.03µs 0.00%
Mini js (Compiler) 6.5±6.31µs 6.4±6.09µs -1.54%
Mini js (Execution) 989.4±8.45µs 867.4±4.24µs -12.33%
Mini js (Parser) 33.6±0.07µs 33.4±0.07µs -0.60%
Number Object Access (Compiler) 1451.4±1792.97ns 1550.9±1452.01ns +6.86%
Number Object Access (Execution) 6.9±9.43µs 6.3±5.01µs -8.70%
Number Object Access (Parser) 13.8±0.03µs 13.7±0.06µs -0.72%
Object Creation (Compiler) 2.6±4.03µs 2.6±4.20µs 0.00%
Object Creation (Execution) 5.3±10.10µs 5.0±6.44µs -5.66%
Object Creation (Parser) 11.6±0.03µs 11.5±0.02µs -0.86%
RegExp (Compiler) 3.4±7.47µs 2.5±3.68µs -26.47%
RegExp (Execution) 15.8±11.42µs 16.2±16.46µs +2.53%
RegExp (Parser) 12.4±0.03µs 12.4±0.02µs 0.00%
RegExp Creation (Compiler) 2.4±3.19µs 2.7±3.46µs +12.50%
RegExp Creation (Execution) 10.9±12.15µs 12.4±25.84µs +13.76%
RegExp Creation (Parser) 10.4±0.02µs 10.3±0.02µs -0.96%
RegExp Literal (Compiler) 3.9±11.40µs 2.9±3.86µs -25.64%
RegExp Literal (Execution) 15.9±15.40µs 18.1±35.82µs +13.84%
RegExp Literal (Parser) 14.4±0.02µs 14.4±0.02µs 0.00%
RegExp Literal Creation (Compiler) 2.4±3.27µs 2.6±3.52µs +8.33%
RegExp Literal Creation (Execution) 11.5±17.62µs 10.1±6.63µs -12.17%
RegExp Literal Creation (Parser) 12.3±0.23µs 12.2±0.02µs -0.81%
Static Object Property Access (Compiler) 2.3±3.26µs 2.3±3.25µs 0.00%
Static Object Property Access (Execution) 5.3±7.65µs 4.8±5.42µs -9.43%
Static Object Property Access (Parser) 12.3±0.07µs 12.2±0.03µs -0.81%
String Object Access (Compiler) 1965.6±1857.54ns 3.0±10.69µs +52.63%
String Object Access (Execution) 12.3±21.90µs 10.3±6.56µs -16.26%
String Object Access (Parser) 17.2±0.04µs 17.1±0.03µs -0.58%
String comparison (Compiler) 4.0±5.16µs 3.8±4.40µs -5.00%
String comparison (Execution) 4.1±4.67µs 4.7±7.49µs +14.63%
String comparison (Parser) 15.0±0.03µs 15.0±0.30µs 0.00%
String concatenation (Compiler) 3.8±9.82µs 2.7±3.67µs -28.95%
String concatenation (Execution) 3.8±4.95µs 3.9±4.61µs +2.63%
String concatenation (Parser) 10.1±0.07µs 10.0±0.02µs -0.99%
String copy (Compiler) 2.3±3.09µs 2.1±3.52µs -8.70%
String copy (Execution) 3.5±4.39µs 3.4±4.32µs -2.86%
String copy (Parser) 7.4±0.02µs 7.3±0.01µs -1.35%
Symbols (Compiler) 1684.7±2932.72ns 1739.4±2909.50ns +3.25%
Symbols (Execution) 4.1±8.12µs 4.1±7.01µs 0.00%
Symbols (Parser) 5.4±0.02µs 5.4±0.02µs 0.00%

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Great change! Just had a small question and a suggestion

boa_engine/src/context/mod.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from bec37d1 to 5366f4a Compare May 5, 2023 16:21
@HalidOdat HalidOdat force-pushed the optimization/direct-array-length-access branch from 5366f4a to 464e2b9 Compare May 5, 2023 16:22
@HalidOdat HalidOdat requested a review from jedel1043 May 5, 2023 16:24
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Everything good!

@jedel1043 jedel1043 enabled auto-merge May 5, 2023 16:25
@jedel1043 jedel1043 added this pull request to the merge queue May 5, 2023
@HalidOdat HalidOdat added this to the v0.17.0 milestone May 5, 2023
@github-actions
Copy link

github-actions bot commented May 5, 2023

Benchmark for ff9b320

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 639.8±862.19ns 593.4±707.14ns -7.25%
Arithmetic operations (Execution) 445.5±0.27ns 454.2±0.33ns +1.95%
Arithmetic operations (Parser) 7.2±0.01µs 7.3±0.02µs +1.39%
Array access (Compiler) 2.3±3.83µs 1950.4±2859.91ns -15.20%
Array access (Execution) 7.4±8.13µs 6.7±7.29µs -9.46%
Array access (Parser) 13.9±0.02µs 13.5±0.02µs -2.88%
Array creation (Compiler) 3.3±3.95µs 3.0±3.59µs -9.09%
Array creation (Execution) 761.8±483.37µs 877.5±1114.72µs +15.19%
Array creation (Parser) 16.9±0.04µs 16.3±0.02µs -3.55%
Array pop (Compiler) 5.3±5.55µs 5.0±5.43µs -5.66%
Array pop (Execution) 629.2±2.18µs 447.9±9.63µs -28.81%
Array pop (Parser) 157.3±0.55µs 149.3±0.27µs -5.09%
Boolean Object Access (Compiler) 1348.2±1396.59ns 1379.6±920.33ns +2.33%
Boolean Object Access (Execution) 7.4±8.71µs 9.5±28.22µs +28.38%
Boolean Object Access (Parser) 15.7±0.03µs 15.4±0.01µs -1.91%
Clean js (Compiler) 6.7±7.45µs 6.6±8.59µs -1.49%
Clean js (Execution) 942.1±691.45µs 808.1±318.61µs -14.22%
Clean js (Parser) 35.6±0.06µs 34.6±0.02µs -2.81%
Create Realm 761.4±3178.78µs 748.7±3187.88µs -1.67%
Dynamic Object Property Access (Compiler) 2.4±3.65µs 2.3±2.99µs -4.17%
Dynamic Object Property Access (Execution) 5.9±17.21µs 4.4±4.92µs -25.42%
Dynamic Object Property Access (Parser) 12.5±0.05µs 12.2±0.02µs -2.40%
Fibonacci (Compiler) 4.8±6.08µs 5.0±6.01µs +4.17%
Fibonacci (Execution) 1083.6±1823.31µs 1054.3±1594.98µs -2.70%
Fibonacci (Parser) 19.4±0.03µs 19.2±0.02µs -1.03%
For loop (Compiler) 4.1±8.48µs 4.0±5.80µs -2.44%
For loop (Execution) 19.7±26.22µs 18.9±21.47µs -4.06%
For loop (Parser) 17.9±0.03µs 17.3±0.07µs -3.35%
Mini js (Compiler) 6.4±8.01µs 5.6±5.19µs -12.50%
Mini js (Execution) 884.5±609.95µs 726.3±2.41µs -17.89%
Mini js (Parser) 31.5±0.06µs 30.8±0.03µs -2.22%
Number Object Access (Compiler) 1429.6±1410.23ns 1449.5±2151.22ns +1.39%
Number Object Access (Execution) 5.6±5.13µs 5.7±5.74µs +1.79%
Number Object Access (Parser) 12.7±0.02µs 12.3±0.02µs -3.15%
Object Creation (Compiler) 2.2±2.95µs 2.1±3.08µs -4.55%
Object Creation (Execution) 4.3±6.65µs 4.2±5.74µs -2.33%
Object Creation (Parser) 10.7±0.02µs 10.6±0.01µs -0.93%
RegExp (Compiler) 2.5±4.45µs 2.2±3.05µs -12.00%
RegExp (Execution) 13.1±12.80µs 13.5±12.29µs +3.05%
RegExp (Parser) 11.7±0.02µs 11.4±0.02µs -2.56%
RegExp Creation (Compiler) 2.6±6.29µs 2.2±3.16µs -15.38%
RegExp Creation (Execution) 8.6±6.49µs 8.8±6.74µs +2.33%
RegExp Creation (Parser) 9.8±0.02µs 9.7±0.01µs -1.02%
RegExp Literal (Compiler) 2.3±3.43µs 2.5±3.45µs +8.70%
RegExp Literal (Execution) 12.9±11.38µs 13.5±11.86µs +4.65%
RegExp Literal (Parser) 12.9±0.03µs 13.0±0.02µs +0.78%
RegExp Literal Creation (Compiler) 2.4±4.00µs 2.0±2.82µs -16.67%
RegExp Literal Creation (Execution) 8.4±6.39µs 8.8±6.45µs +4.76%
RegExp Literal Creation (Parser) 11.0±0.03µs 11.0±0.02µs 0.00%
Static Object Property Access (Compiler) 2.1±2.88µs 2.1±2.98µs 0.00%
Static Object Property Access (Execution) 4.7±8.71µs 5.1±10.51µs +8.51%
Static Object Property Access (Parser) 11.6±0.02µs 11.2±0.01µs -3.45%
String Object Access (Compiler) 1744.2±1725.65ns 1990.6±3455.29ns +14.13%
String Object Access (Execution) 8.7±6.37µs 8.8±6.52µs +1.15%
String Object Access (Parser) 15.6±0.02µs 15.3±0.01µs -1.92%
String comparison (Compiler) 4.2±4.62µs 4.7±7.39µs +11.90%
String comparison (Execution) 4.3±6.96µs 4.2±6.45µs -2.33%
String comparison (Parser) 13.9±0.02µs 13.6±0.01µs -2.16%
String concatenation (Compiler) 3.4±4.51µs 3.4±4.49µs 0.00%
String concatenation (Execution) 4.4±10.86µs 3.9±7.00µs -11.36%
String concatenation (Parser) 9.5±0.02µs 9.4±0.10µs -1.05%
String copy (Compiler) 2.3±3.74µs 5.1±26.54µs +121.74%
String copy (Execution) 3.3±4.50µs 3.2±4.33µs -3.03%
String copy (Parser) 7.0±0.01µs 7.0±0.01µs 0.00%
Symbols (Compiler) 1512.2±2561.01ns 1618.5±2570.55ns +7.03%
Symbols (Execution) 3.4±5.41µs 3.8±8.19µs +11.76%
Symbols (Parser) 5.2±0.02µs 5.2±0.02µs 0.00%

@github-actions
Copy link

github-actions bot commented May 5, 2023

Benchmark for 2efc034

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 850.9±1118.73ns 1007.4±1943.96ns +18.39%
Arithmetic operations (Execution) 556.9±31.76ns 573.9±45.25ns +3.05%
Arithmetic operations (Parser) 8.8±0.35µs 9.4±0.42µs +6.82%
Array access (Compiler) 2.7±3.20µs 2.5±3.56µs -7.41%
Array access (Execution) 9.4±11.88µs 10.1±20.54µs +7.45%
Array access (Parser) 17.5±0.41µs 17.2±1.00µs -1.71%
Array creation (Compiler) 3.4±3.78µs 5.6±20.43µs +64.71%
Array creation (Execution) 981.4±757.64µs 1031.0±842.37µs +5.05%
Array creation (Parser) 22.5±0.95µs 22.5±1.15µs 0.00%
Array pop (Compiler) 6.5±9.36µs 6.9±8.52µs +6.15%
Array pop (Execution) 842.5±303.66µs 615.4±592.21µs -26.96%
Array pop (Parser) 202.9±8.32µs 202.1±11.26µs -0.39%
Boolean Object Access (Compiler) 1677.6±1500.62ns 2.0±2.40µs +19.22%
Boolean Object Access (Execution) 9.9±11.50µs 10.0±13.11µs +1.01%
Boolean Object Access (Parser) 19.8±0.74µs 20.3±1.23µs +2.53%
Clean js (Compiler) 7.8±7.15µs 9.0±12.09µs +15.38%
Clean js (Execution) 1184.9±600.27µs 1076.8±653.89µs -9.12%
Clean js (Parser) 45.7±2.43µs 46.3±2.57µs +1.31%
Create Realm 1090.8±4366.80µs 1096.9±4439.72µs +0.56%
Dynamic Object Property Access (Compiler) 3.2±4.16µs 3.3±4.64µs +3.12%
Dynamic Object Property Access (Execution) 6.4±14.41µs 5.8±7.83µs -9.38%
Dynamic Object Property Access (Parser) 16.8±0.66µs 17.0±0.85µs +1.19%
Fibonacci (Compiler) 5.8±5.50µs 5.8±5.05µs 0.00%
Fibonacci (Execution) 1076.6±1091.26µs 1147.6±1083.41µs +6.59%
Fibonacci (Parser) 25.6±1.46µs 24.7±1.34µs -3.52%
For loop (Compiler) 4.8±5.05µs 4.9±5.06µs +2.08%
For loop (Execution) 24.2±33.10µs 25.2±33.60µs +4.13%
For loop (Parser) 23.0±0.86µs 23.1±1.38µs +0.43%
Mini js (Compiler) 7.2±6.64µs 8.0±8.78µs +11.11%
Mini js (Execution) 1053.1±41.40µs 961.1±46.26µs -8.74%
Mini js (Parser) 40.5±1.28µs 41.1±1.97µs +1.48%
Number Object Access (Compiler) 1741.2±1336.65ns 1908.8±3890.66ns +9.63%
Number Object Access (Execution) 8.7±18.23µs 8.6±18.27µs -1.15%
Number Object Access (Parser) 15.8±0.69µs 16.4±0.55µs +3.80%
Object Creation (Compiler) 2.9±3.90µs 2.6±3.21µs -10.34%
Object Creation (Execution) 17.5±127.19µs 6.6±15.67µs -62.29%
Object Creation (Parser) 14.2±0.58µs 14.2±0.88µs 0.00%
RegExp (Compiler) 4.3±15.44µs 2.8±3.66µs -34.88%
RegExp (Execution) 17.3±11.06µs 17.0±13.67µs -1.73%
RegExp (Parser) 15.0±0.38µs 15.0±0.91µs 0.00%
RegExp Creation (Compiler) 3.6±8.01µs 2.7±3.94µs -25.00%
RegExp Creation (Execution) 12.6±17.98µs 11.0±7.59µs -12.70%
RegExp Creation (Parser) 13.0±0.65µs 13.0±0.50µs 0.00%
RegExp Literal (Compiler) 3.0±4.34µs 3.9±10.36µs +30.00%
RegExp Literal (Execution) 18.3±18.93µs 20.1±34.61µs +9.84%
RegExp Literal (Parser) 17.6±1.08µs 18.1±1.11µs +2.84%
RegExp Literal Creation (Compiler) 3.1±5.02µs 3.2±5.99µs +3.23%
RegExp Literal Creation (Execution) 10.9±7.87µs 12.2±11.44µs +11.93%
RegExp Literal Creation (Parser) 14.5±1.17µs 14.3±0.63µs -1.38%
Static Object Property Access (Compiler) 3.3±6.83µs 2.8±4.13µs -15.15%
Static Object Property Access (Execution) 5.4±8.06µs 5.5±7.11µs +1.85%
Static Object Property Access (Parser) 15.4±1.14µs 15.3±0.66µs -0.65%
String Object Access (Compiler) 3.5±13.23µs 2.4±2.16µs -31.43%
String Object Access (Execution) 11.6±8.83µs 12.1±9.94µs +4.31%
String Object Access (Parser) 20.1±1.71µs 20.8±1.15µs +3.48%
String comparison (Compiler) 5.4±5.75µs 5.4±5.72µs 0.00%
String comparison (Execution) 5.1±7.12µs 4.9±5.42µs -3.92%
String comparison (Parser) 17.6±0.48µs 18.1±0.78µs +2.84%
String concatenation (Compiler) 3.8±4.16µs 3.6±4.09µs -5.26%
String concatenation (Execution) 4.1±5.28µs 4.7±7.33µs +14.63%
String concatenation (Parser) 12.2±0.60µs 12.3±0.49µs +0.82%
String copy (Compiler) 3.7±7.66µs 4.0±7.77µs +8.11%
String copy (Execution) 4.2±6.92µs 4.6±8.46µs +9.52%
String copy (Parser) 9.0±0.38µs 9.3±0.41µs +3.33%
Symbols (Compiler) 2.0±3.07µs 2.0±3.04µs 0.00%
Symbols (Execution) 4.0±6.17µs 4.0±5.35µs 0.00%
Symbols (Parser) 6.7±0.37µs 6.6±0.45µs -1.49%

Merged via the queue into main with commit 31a60cb May 5, 2023
@jedel1043 jedel1043 deleted the optimization/direct-array-length-access branch May 5, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execution Issues or PRs related to code execution performance Performance related changes and issues run-benchmark Label used to run banchmarks on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants