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

Strict Mode Lex/Parse #717

Merged
merged 22 commits into from Oct 5, 2020
Merged

Strict Mode Lex/Parse #717

merged 22 commits into from Oct 5, 2020

Conversation

Lan2u
Copy link

@Lan2u Lan2u commented Sep 26, 2020

This Pull Request addresses #716.

It changes the following:

  • Add strict mode handling to lex/parsing code

@Lan2u Lan2u self-assigned this Sep 26, 2020
@Lan2u Lan2u changed the title Add strict mode to lex trait Strict Mode Lex/Parse Sep 26, 2020
@codecov
Copy link

codecov bot commented Sep 26, 2020

Codecov Report

Merging #717 into master will increase coverage by 0.06%.
The diff coverage is 65.97%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #717      +/-   ##
==========================================
+ Coverage   59.13%   59.20%   +0.06%     
==========================================
  Files         155      155              
  Lines        9838     9905      +67     
==========================================
+ Hits         5818     5864      +46     
- Misses       4020     4041      +21     
Impacted Files Coverage Δ
boa/src/syntax/parser/statement/switch/mod.rs 69.09% <ø> (ø)
boa/src/syntax/lexer/identifier.rs 62.50% <27.27%> (-22.12%) ⬇️
boa/src/syntax/parser/statement/mod.rs 54.08% <51.61%> (-2.35%) ⬇️
boa/src/syntax/parser/function/mod.rs 67.69% <58.33%> (-3.74%) ⬇️
boa/src/syntax/parser/statement/block/mod.rs 83.33% <60.00%> (+0.98%) ⬆️
boa/src/syntax/parser/mod.rs 72.00% <77.77%> (+3.57%) ⬆️
boa/src/syntax/parser/expression/unary.rs 80.55% <87.50%> (+1.24%) ⬆️
boa/src/syntax/lexer/cursor.rs 62.39% <100.00%> (+1.33%) ⬆️
boa/src/syntax/lexer/mod.rs 67.64% <100.00%> (+1.64%) ⬆️
boa/src/syntax/lexer/number.rs 64.22% <100.00%> (+0.81%) ⬆️
... and 10 more

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 2a509de...877babe. Read the comment docs.

@github-actions
Copy link

Benchmark for 70bd6f4

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 348.0±16.57ns 367.2±5.16ns -5.23%
Arithmetic operations (Full) 234.8±14.48µs 230.1±12.10µs +2.04%
Array access (Execution) 8.1±0.11µs 7.4±0.26µs +9.46%
Array access (Full) 271.9±5.53µs 256.1±10.53µs +6.17%
Array creation (Execution) 3.3±0.04ms 2.9±0.13ms +13.79%
Array creation (Full) 3.5±0.20ms 3.4±0.15ms +2.94%
Array pop (Execution) 1187.0±27.06µs 1028.5±46.22µs +15.41%
Array pop (Full) 1606.0±91.34µs 1624.0±35.59µs -1.11%
Boolean Object Access (Execution) 4.5±0.20µs 4.4±0.24µs +2.27%
Boolean Object Access (Full) 237.8±10.91µs 255.2±10.30µs -6.82%
Clean js (Execution) 714.2±30.55µs 660.2±35.41µs +8.18%
Clean js (Full) 979.8±37.35µs 979.0±50.34µs +0.08%
Clean js (Parser) 29.3±1.74µs 33.5±1.72µs -12.54%
Create Realm 469.4±4.73ns 446.5±23.46ns +5.13%
Dynamic Object Property Access (Execution) 5.3±0.06µs 4.8±0.29µs +10.42%
Dynamic Object Property Access (Full) 248.8±10.79µs 258.5±6.92µs -3.75%
Expression (Parser) 6.0±0.30µs 6.3±0.39µs -4.76%
Fibonacci (Execution) 787.9±13.72µs 780.6±24.50µs +0.94%
Fibonacci (Full) 1066.8±25.02µs 1039.7±29.09µs +2.61%
For loop (Execution) 22.1±0.22µs 21.0±0.81µs +5.24%
For loop (Full) 278.2±8.20µs 275.3±7.05µs +1.05%
For loop (Parser) 15.9±0.80µs 15.8±1.02µs +0.63%
Goal Symbols (Parser) 11.0±0.48µs 11.2±0.71µs -1.79%
Hello World (Parser) 2.6±0.18µs 2.7±0.21µs -3.70%
Long file (Parser) 740.5±17.54ns 734.0±39.42ns +0.89%
Mini js (Execution) 665.0±13.12µs 645.7±19.80µs +2.99%
Mini js (Full) 893.9±43.66µs 872.7±59.17µs +2.43%
Mini js (Parser) 28.3±1.56µs 30.5±1.06µs -7.21%
Number Object Access (Execution) 3.8±0.09µs 3.5±0.18µs +8.57%
Number Object Access (Full) 242.8±22.27µs 244.6±12.03µs -0.74%
Object Creation (Execution) 4.5±0.04µs 4.1±0.17µs +9.76%
Object Creation (Full) 263.0±4.91µs 253.2±12.35µs +3.87%
RegExp (Execution) 65.3±0.91µs 62.2±2.45µs +4.98%
RegExp (Full) 317.8±22.00µs 319.4±14.39µs -0.50%
RegExp Literal (Execution) 68.1±1.34µs 64.3±2.43µs +5.91%
RegExp Literal (Full) 333.1±10.50µs 302.1±16.22µs +10.26%
RegExp Literal Creation (Execution) 65.0±0.92µs 61.2±3.12µs +6.21%
RegExp Literal Creation (Full) 320.6±15.06µs 326.9±17.81µs -1.93%
Static Object Property Access (Execution) 4.6±0.19µs 4.6±0.20µs 0.00%
Static Object Property Access (Full) 261.5±5.62µs 246.3±9.27µs +6.17%
String Object Access (Execution) 6.5±0.39µs 6.4±0.36µs +1.56%
String Object Access (Full) 255.8±7.80µs 256.7±10.24µs -0.35%
String comparison (Execution) 6.4±0.05µs 6.0±0.19µs +6.67%
String comparison (Full) 266.4±2.45µs 253.8±11.62µs +4.96%
String concatenation (Execution) 5.2±0.02µs 4.7±0.18µs +10.64%
String concatenation (Full) 246.5±12.85µs 261.5±3.05µs -5.74%
String copy (Execution) 3.8±0.06µs 3.6±0.12µs +5.56%
String copy (Full) 257.7±4.52µs 242.6±9.02µs +6.22%
Symbols (Execution) 3.1±0.03µs 2.8±0.15µs +10.71%
Symbols (Full) 237.3±3.76µs 232.7±8.48µs +1.98%

@github-actions
Copy link

Benchmark for e52f418

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 368.1±29.12ns 377.3±36.30ns -2.44%
Arithmetic operations (Full) 264.6±23.67µs 264.8±23.24µs -0.08%
Array access (Execution) 8.9±0.50µs 8.8±0.85µs +1.14%
Array access (Full) 301.3±26.55µs 286.0±24.05µs +5.35%
Array creation (Execution) 3.5±0.22ms 3.4±0.36ms +2.94%
Array creation (Full) 3.5±0.28ms 3.5±0.26ms 0.00%
Array pop (Execution) 1220.1±60.44µs 1130.2±78.02µs +7.95%
Array pop (Full) 1607.5±126.15µs 1588.3±132.55µs +1.21%
Boolean Object Access (Execution) 5.2±0.36µs 5.0±0.45µs +4.00%
Boolean Object Access (Full) 275.8±22.64µs 279.8±19.12µs -1.43%
Clean js (Execution) 844.1±88.14µs 752.0±64.18µs +12.25%
Clean js (Full) 1025.0±92.67µs 1102.9±102.57µs -7.06%
Clean js (Parser) 38.6±4.59µs 37.6±3.72µs +2.66%
Create Realm 510.9±35.50ns 463.6±43.94ns +10.20%
Dynamic Object Property Access (Execution) 6.1±0.48µs 5.5±0.35µs +10.91%
Dynamic Object Property Access (Full) 301.9±36.23µs 279.2±20.57µs +8.13%
Expression (Parser) 6.8±0.57µs 6.7±0.58µs +1.49%
Fibonacci (Execution) 920.0±45.58µs 923.8±79.76µs -0.41%
Fibonacci (Full) 1155.8±71.85µs 1189.5±91.10µs -2.83%
For loop (Execution) 24.7±1.68µs 23.1±1.78µs +6.93%
For loop (Full) 307.6±28.37µs 305.4±27.11µs +0.72%
For loop (Parser) 18.3±2.11µs 19.8±2.17µs -7.58%
Goal Symbols (Parser) 11.8±1.30µs 12.4±1.10µs -4.84%
Hello World (Parser) 3.2±0.34µs 3.2±0.25µs 0.00%
Long file (Parser) 820.0±80.57ns 844.7±62.72ns -2.92%
Mini js (Execution) 725.7±57.30µs 683.2±64.83µs +6.22%
Mini js (Full) 981.2±73.75µs 973.0±82.10µs +0.84%
Mini js (Parser) 30.8±2.16µs 32.8±3.03µs -6.10%
Number Object Access (Execution) 4.1±0.29µs 4.0±0.44µs +2.50%
Number Object Access (Full) 278.6±22.01µs 278.3±17.73µs +0.11%
Object Creation (Execution) 5.1±0.34µs 4.9±0.42µs +4.08%
Object Creation (Full) 276.0±21.57µs 268.1±21.32µs +2.95%
RegExp (Execution) 73.3±6.81µs 71.7±7.35µs +2.23%
RegExp (Full) 377.1±30.32µs 367.4±32.32µs +2.64%
RegExp Literal (Execution) 76.4±5.53µs 71.3±5.36µs +7.15%
RegExp Literal (Full) 372.4±23.04µs 361.7±27.62µs +2.96%
RegExp Literal Creation (Execution) 72.5±4.76µs 69.0±6.17µs +5.07%
RegExp Literal Creation (Full) 363.5±19.29µs 367.3±27.58µs -1.03%
Static Object Property Access (Execution) 5.5±0.38µs 5.0±0.45µs +10.00%
Static Object Property Access (Full) 289.1±20.50µs 285.4±30.34µs +1.30%
String Object Access (Execution) 7.3±0.60µs 7.4±0.77µs -1.35%
String Object Access (Full) 277.3±21.22µs 281.8±18.50µs -1.60%
String comparison (Execution) 6.8±0.45µs 7.0±0.67µs -2.86%
String comparison (Full) 290.9±31.77µs 297.0±21.65µs -2.05%
String concatenation (Execution) 5.5±0.35µs 5.5±0.46µs 0.00%
String concatenation (Full) 289.8±22.64µs 266.7±22.69µs +8.66%
String copy (Execution) 4.2±0.29µs 4.2±0.34µs 0.00%
String copy (Full) 281.9±27.59µs 274.5±19.49µs +2.70%
Symbols (Execution) 3.4±0.16µs 3.4±0.37µs 0.00%
Symbols (Full) 256.9±16.89µs 249.0±30.37µs +3.17%

@github-actions
Copy link

Benchmark for e2c867d

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 348.7±23.06ns 355.2±9.61ns -1.83%
Arithmetic operations (Full) 254.2±10.17µs 249.4±12.25µs +1.92%
Array access (Execution) 7.8±0.35µs 8.2±0.42µs -4.88%
Array access (Full) 273.4±14.67µs 281.0±14.11µs -2.70%
Array creation (Execution) 3.0±0.10ms 3.1±0.13ms -3.23%
Array creation (Full) 3.2±0.11ms 3.3±0.08ms -3.03%
Array pop (Execution) 1166.0±23.01µs 1003.4±39.59µs +16.20%
Array pop (Full) 1558.7±70.26µs 1527.1±35.32µs +2.07%
Boolean Object Access (Execution) 4.9±0.20µs 4.7±0.13µs +4.26%
Boolean Object Access (Full) 269.7±11.92µs 255.3±8.00µs +5.64%
Clean js (Execution) 706.5±32.49µs 713.1±18.51µs -0.93%
Clean js (Full) 962.8±49.19µs 969.9±35.92µs -0.73%
Clean js (Parser) 36.4±3.89µs 36.6±1.78µs -0.55%
Create Realm 461.3±36.61ns 429.0±20.99ns +7.53%
Dynamic Object Property Access (Execution) 5.4±0.20µs 5.4±0.28µs 0.00%
Dynamic Object Property Access (Full) 275.6±10.26µs 274.9±10.87µs +0.25%
Expression (Parser) 6.4±0.29µs 6.4±0.37µs 0.00%
Fibonacci (Execution) 825.9±29.17µs 885.6±52.85µs -6.74%
Fibonacci (Full) 1163.0±69.11µs 1153.4±58.22µs +0.83%
For loop (Execution) 22.3±0.97µs 21.6±1.07µs +3.24%
For loop (Full) 304.5±16.21µs 292.8±10.49µs +4.00%
For loop (Parser) 16.7±0.75µs 17.5±0.89µs -4.57%
Goal Symbols (Parser) 12.4±0.98µs 11.8±0.60µs +5.08%
Hello World (Parser) 3.0±0.17µs 3.0±0.13µs 0.00%
Long file (Parser) 787.6±56.91ns 766.1±52.86ns +2.81%
Mini js (Execution) 678.6±61.28µs 644.1±16.75µs +5.36%
Mini js (Full) 874.8±35.08µs 910.6±40.79µs -3.93%
Mini js (Parser) 32.2±1.36µs 32.2±1.26µs 0.00%
Number Object Access (Execution) 3.7±0.22µs 3.9±0.14µs -5.13%
Number Object Access (Full) 258.8±17.64µs 251.6±11.84µs +2.86%
Object Creation (Execution) 4.6±0.13µs 4.4±0.20µs +4.55%
Object Creation (Full) 275.0±16.03µs 268.5±9.12µs +2.42%
RegExp (Execution) 67.8±3.94µs 67.0±2.28µs +1.19%
RegExp (Full) 347.2±11.16µs 348.0±9.51µs -0.23%
RegExp Literal (Execution) 68.7±3.53µs 72.0±3.36µs -4.58%
RegExp Literal (Full) 347.5±14.82µs 350.7±16.78µs -0.91%
RegExp Literal Creation (Execution) 67.1±2.50µs 67.2±4.45µs -0.15%
RegExp Literal Creation (Full) 324.6±11.82µs 335.4±8.90µs -3.22%
Static Object Property Access (Execution) 4.9±0.18µs 4.6±0.16µs +6.52%
Static Object Property Access (Full) 263.2±12.32µs 268.7±7.82µs -2.05%
String Object Access (Execution) 7.0±0.34µs 7.0±0.33µs 0.00%
String Object Access (Full) 269.0±11.52µs 268.6±8.57µs +0.15%
String comparison (Execution) 6.4±0.36µs 6.4±0.21µs 0.00%
String comparison (Full) 268.6±9.87µs 258.1±11.50µs +4.07%
String concatenation (Execution) 5.3±0.44µs 5.4±0.18µs -1.85%
String concatenation (Full) 269.9±8.09µs 267.4±6.31µs +0.93%
String copy (Execution) 4.1±0.15µs 4.1±0.09µs 0.00%
String copy (Full) 250.2±11.22µs 263.5±10.25µs -5.05%
Symbols (Execution) 3.2±0.16µs 3.2±0.11µs 0.00%
Symbols (Full) 245.9±12.32µs 241.5±6.63µs +1.82%

@Razican
Copy link
Member

Razican commented Oct 1, 2020

One thing that is needed is a way for knowing if we are in strict mode from the parser, since we do need to change some parsing semantics.

@Lan2u
Copy link
Author

Lan2u commented Oct 1, 2020

One thing that is needed is a way for knowing if we are in strict mode from the parser, since we do need to change some parsing semantics.

For the parser this should be fine as the use strict directive is read at the parser level, my thought was that we can pass strict_mode as an argument between parse functions with a flag on the parser used if global strict mode is enabled.

What might be more complicated is enforcing stuff like "strict mode makes attempts to delete undeletable properties throw" as we may not be able to do this during parsing.

@Razican
Copy link
Member

Razican commented Oct 1, 2020

For the parser this should be fine as the use strict directive is read at the parser level, my thought was that we can pass strict_mode as an argument between parse functions with a flag on the parser used if global strict mode is enabled.

We already pass the lexer as an argument, and the strict mode is relevant when lexing. I would add a strict_mode attribute in the lexer, that can be set and retrieved by the parser, similarly to goal symbols.

What might be more complicated is enforcing stuff like "strict mode makes attempts to delete undeletable properties throw" as we may not be able to do this during parsing.

I think that we should have a strict_mode flag in the interpreter, that could be retrieved from each node executors.

If I understand the strict mode properly, it starts to take effect once it is declared, but I'm not sure about the scope. If it has a function scope, then the parser must be able to set it to false after parsing the function, and the executor should be able to check the string literal to set its own flag on execution.

@Lan2u
Copy link
Author

Lan2u commented Oct 1, 2020

For the parser this should be fine as the use strict directive is read at the parser level, my thought was that we can pass strict_mode as an argument between parse functions with a flag on the parser used if global strict mode is enabled.

We already pass the lexer as an argument, and the strict mode is relevant when lexing. I would add a strict_mode attribute in the lexer, that can be set and retrieved by the parser, similarly to goal symbols.

What might be more complicated is enforcing stuff like "strict mode makes attempts to delete undeletable properties throw" as we may not be able to do this during parsing.

I think that we should have a strict_mode flag in the interpreter, that could be retrieved from each node executors.

If I understand the strict mode properly, it starts to take effect once it is declared, but I'm not sure about the scope. If it has a function scope, then the parser must be able to set it to false after parsing the function, and the executor should be able to check the string literal to set its own flag on execution.

Thinking about this more I see the benefit of using a flag on lexer.

Ignore below

I put strict_mode as a flag to lex() which I think might work better than trying to make sure we set a flag on the parser when we exit function scope. This way if the entire script is strict mode then we just set it to true at the top level and it carries through and if only a function is strict mode then we just set the flag to true when parsing the function statement list and this way it won't accidentally apply to too wide a scope. Also to me having it included in lex/parse means that if someone later wants to add another thing to lex/parse it is apparent that the strict mode case needs to be handled and how to do so is easy to understand.

@Lan2u Lan2u marked this pull request as ready for review October 4, 2020 10:50
@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for 238662e

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 384.1±23.31ns 362.7±23.95ns +5.90%
Arithmetic operations (Full) 272.4±14.20µs 272.2±11.85µs +0.07%
Array access (Execution) 8.9±0.40µs 8.5±0.34µs +4.71%
Array access (Full) 302.1±15.86µs 295.0±14.20µs +2.41%
Array creation (Execution) 3.3±0.16ms 3.2±0.10ms +3.13%
Array creation (Full) 3.4±0.14ms 3.4±0.14ms 0.00%
Array pop (Execution) 1167.2±52.70µs 1098.4±52.42µs +6.26%
Array pop (Full) 1618.3±68.09µs 1582.7±62.95µs +2.25%
Boolean Object Access (Execution) 5.4±0.25µs 5.2±0.26µs +3.85%
Boolean Object Access (Full) 292.8±14.43µs 294.4±14.44µs -0.54%
Clean js (Execution) 769.0±29.73µs 746.1±33.48µs +3.07%
Clean js (Full) 1075.7±56.72µs 1032.8±42.36µs +4.15%
Clean js (Parser) 40.0±1.82µs 38.2±2.11µs +4.71%
Create Realm 498.8±19.83ns 482.5±22.66ns +3.38%
Dynamic Object Property Access (Execution) 6.2±0.24µs 6.1±0.29µs +1.64%
Dynamic Object Property Access (Full) 292.1±9.52µs 285.5±11.00µs +2.31%
Expression (Parser) 7.1±0.33µs 6.9±0.47µs +2.90%
Fibonacci (Execution) 957.7±38.20µs 945.3±45.14µs +1.31%
Fibonacci (Full) 1294.5±63.35µs 1256.8±48.42µs +3.00%
For loop (Execution) 23.6±0.97µs 23.8±1.25µs -0.84%
For loop (Full) 321.3±14.90µs 312.7±11.81µs +2.75%
For loop (Parser) 19.2±1.05µs 18.1±0.99µs +6.08%
Goal Symbols (Parser) 12.7±0.56µs 12.0±0.61µs +5.83%
Hello World (Parser) 3.3±0.25µs 3.2±0.12µs +3.12%
Long file (Parser) 829.5±42.85ns 777.8±39.80ns +6.65%
Mini js (Execution) 684.4±30.12µs 662.7±32.23µs +3.27%
Mini js (Full) 967.9±40.64µs 956.8±45.20µs +1.16%
Mini js (Parser) 35.5±1.66µs 33.4±1.70µs +6.29%
Number Object Access (Execution) 4.3±0.21µs 4.2±0.27µs +2.38%
Number Object Access (Full) 290.8±15.77µs 279.5±11.14µs +4.04%
Object Creation (Execution) 5.3±0.25µs 5.3±0.22µs 0.00%
Object Creation (Full) 285.3±13.90µs 293.2±12.87µs -2.69%
RegExp (Execution) 70.2±2.59µs 69.5±3.05µs +1.01%
RegExp (Full) 366.0±15.84µs 369.6±12.29µs -0.97%
RegExp Literal (Execution) 75.0±2.32µs 72.7±4.79µs +3.16%
RegExp Literal (Full) 364.6±20.26µs 369.6±14.01µs -1.35%
RegExp Literal Creation (Execution) 70.3±3.31µs 70.6±5.43µs -0.42%
RegExp Literal Creation (Full) 365.0±14.63µs 374.7±14.25µs -2.59%
Static Object Property Access (Execution) 5.5±0.20µs 5.7±0.27µs -3.51%
Static Object Property Access (Full) 291.6±14.32µs 285.6±11.22µs +2.10%
String Object Access (Execution) 7.6±0.34µs 7.4±0.47µs +2.70%
String Object Access (Full) 292.9±12.83µs 289.3±19.14µs +1.24%
String comparison (Execution) 7.0±0.29µs 6.9±0.28µs +1.45%
String comparison (Full) 289.7±13.18µs 296.3±19.25µs -2.23%
String concatenation (Execution) 5.9±0.30µs 5.6±0.28µs +5.36%
String concatenation (Full) 292.0±15.29µs 301.2±11.82µs -3.05%
String copy (Execution) 4.5±0.19µs 4.4±0.20µs +2.27%
String copy (Full) 283.2±11.22µs 280.8±9.79µs +0.85%
Symbols (Execution) 3.7±0.16µs 3.6±0.15µs +2.78%
Symbols (Full) 269.7±17.58µs 271.4±16.77µs -0.63%

@Lan2u Lan2u marked this pull request as draft October 4, 2020 11:35
@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for b359035

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 372.0±1.70ns 369.1±2.91ns +0.79%
Arithmetic operations (Full) 252.0±1.58µs 251.5±0.57µs +0.20%
Array access (Execution) 8.0±0.07µs 8.0±0.04µs 0.00%
Array access (Full) 274.9±1.41µs 272.5±2.09µs +0.88%
Array creation (Execution) 3.4±0.02ms 3.3±0.02ms +3.03%
Array creation (Full) 3.6±0.02ms 3.6±0.02ms 0.00%
Array pop (Execution) 1220.0±7.15µs 1189.2±11.09µs +2.59%
Array pop (Full) 1652.2±9.41µs 1642.5±10.60µs +0.59%
Boolean Object Access (Execution) 4.9±0.04µs 5.0±0.03µs -2.00%
Boolean Object Access (Full) 263.7±2.71µs 262.7±1.96µs +0.38%
Clean js (Execution) 743.9±5.58µs 729.3±5.97µs +2.00%
Clean js (Full) 1041.9±13.21µs 1042.0±13.08µs -0.01%
Clean js (Parser) 36.0±0.28µs 35.1±0.37µs +2.56%
Create Realm 496.9±4.30ns 460.2±3.25ns +7.97%
Dynamic Object Property Access (Execution) 5.6±0.06µs 5.5±0.04µs +1.82%
Dynamic Object Property Access (Full) 271.0±1.08µs 266.2±1.59µs +1.80%
Expression (Parser) 6.7±0.05µs 6.8±0.02µs -1.47%
Fibonacci (Execution) 832.6±5.75µs 812.7±6.11µs +2.45%
Fibonacci (Full) 1131.1±6.26µs 1109.7±11.41µs +1.93%
For loop (Execution) 22.3±0.17µs 22.2±0.21µs +0.45%
For loop (Full) 289.5±2.68µs 289.3±1.71µs +0.07%
For loop (Parser) 17.6±0.11µs 17.2±0.12µs +2.33%
Goal Symbols (Parser) 12.1±0.08µs 11.8±0.09µs +2.54%
Hello World (Parser) 3.1±0.02µs 3.1±0.01µs 0.00%
Long file (Parser) 767.8±5.05ns 781.8±3.38ns -1.79%
Mini js (Execution) 668.3±5.76µs 660.8±5.57µs +1.13%
Mini js (Full) 957.1±6.01µs 960.0±3.85µs -0.30%
Mini js (Parser) 31.5±0.20µs 30.8±0.26µs +2.27%
Number Object Access (Execution) 3.9±0.02µs 3.9±0.03µs 0.00%
Number Object Access (Full) 261.6±1.72µs 261.4±1.04µs +0.08%
Object Creation (Execution) 4.7±0.04µs 4.7±0.04µs 0.00%
Object Creation (Full) 267.0±2.35µs 262.8±1.83µs +1.60%
RegExp (Execution) 65.2±0.94µs 64.8±1.08µs +0.62%
RegExp (Full) 348.8±1.47µs 350.3±1.97µs -0.43%
RegExp Literal (Execution) 68.2±1.36µs 67.3±1.31µs +1.34%
RegExp Literal (Full) 346.1±1.68µs 340.8±3.18µs +1.56%
RegExp Literal Creation (Execution) 65.6±3.66µs 64.1±0.99µs +2.34%
RegExp Literal Creation (Full) 339.6±2.44µs 337.4±2.51µs +0.65%
Static Object Property Access (Execution) 5.0±0.03µs 5.0±0.05µs 0.00%
Static Object Property Access (Full) 267.8±2.42µs 265.3±2.15µs +0.94%
String Object Access (Execution) 7.0±0.04µs 7.1±0.08µs -1.41%
String Object Access (Full) 268.6±3.84µs 268.8±1.31µs -0.07%
String comparison (Execution) 6.4±0.04µs 6.4±0.04µs 0.00%
String comparison (Full) 271.4±1.43µs 268.2±2.27µs +1.19%
String concatenation (Execution) 5.3±0.03µs 5.1±0.07µs +3.92%
String concatenation (Full) 265.6±2.17µs 263.9±2.69µs +0.64%
String copy (Execution) 4.0±0.02µs 3.9±0.04µs +2.56%
String copy (Full) 257.0±1.29µs 254.5±2.45µs +0.98%
Symbols (Execution) 3.3±0.03µs 3.3±0.01µs 0.00%
Symbols (Full) 255.5±1.15µs 254.2±2.10µs +0.51%

@Lan2u Lan2u marked this pull request as ready for review October 4, 2020 14:54
@Lan2u Lan2u linked an issue Oct 4, 2020 that may be closed by this pull request
5 tasks
@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for 6f794bc

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 353.8±35.31ns 347.3±36.45ns +1.87%
Arithmetic operations (Full) 263.9±28.11µs 263.0±26.11µs +0.34%
Array access (Execution) 8.1±0.88µs 8.0±0.81µs +1.25%
Array access (Full) 292.0±34.22µs 283.7±29.20µs +2.93%
Array creation (Execution) 3.0±0.30ms 3.1±0.36ms -3.23%
Array creation (Full) 3.3±0.30ms 3.2±0.30ms +3.13%
Array pop (Execution) 1033.3±84.93µs 1038.5±93.58µs -0.50%
Array pop (Full) 1494.2±122.45µs 1540.8±193.68µs -3.02%
Boolean Object Access (Execution) 4.8±0.47µs 4.8±0.36µs 0.00%
Boolean Object Access (Full) 266.4±22.60µs 273.7±29.41µs -2.67%
Clean js (Execution) 742.5±84.34µs 710.4±61.79µs +4.52%
Clean js (Full) 1081.0±109.03µs 1054.6±119.50µs +2.50%
Clean js (Parser) 187.9±36.07µs 36.2±3.54µs +419.06%
Create Realm 463.2±47.48ns 462.6±31.26ns +0.13%
Dynamic Object Property Access (Execution) 5.7±0.61µs 6.1±0.71µs -6.56%
Dynamic Object Property Access (Full) 267.0±19.19µs 275.4±27.49µs -3.05%
Expression (Parser) 6.9±0.79µs 6.6±1.17µs +4.55%
Fibonacci (Execution) 877.2±72.28µs 913.7±98.56µs -3.99%
Fibonacci (Full) 1179.4±102.13µs 1260.1±147.65µs -6.40%
For loop (Execution) 22.9±2.32µs 22.5±2.28µs +1.78%
For loop (Full) 292.3±23.68µs 301.6±33.84µs -3.08%
For loop (Parser) 18.5±2.18µs 17.8±1.97µs +3.93%
Goal Symbols (Parser) 12.0±1.29µs 11.8±1.18µs +1.69%
Hello World (Parser) 3.2±0.39µs 3.2±0.49µs 0.00%
Long file (Parser) 534.8±46.39ns 542.4±58.39ns -1.40%
Mini js (Execution) 647.0±68.85µs 673.6±45.75µs -3.95%
Mini js (Full) 1001.6±99.60µs 931.5±92.69µs +7.53%
Mini js (Parser) 167.8±28.77µs 30.9±2.39µs +443.04%
Number Object Access (Execution) 3.9±0.41µs 4.1±0.56µs -4.88%
Number Object Access (Full) 271.2±22.90µs 273.4±26.36µs -0.80%
Object Creation (Execution) 4.9±0.59µs 4.8±0.39µs +2.08%
Object Creation (Full) 271.3±24.63µs 279.3±30.67µs -2.86%
RegExp (Execution) 66.2±5.60µs 68.5±6.88µs -3.36%
RegExp (Full) 355.6±33.22µs 344.2±36.79µs +3.31%
RegExp Literal (Execution) 72.7±8.76µs 74.1±9.48µs -1.89%
RegExp Literal (Full) 350.6±34.42µs 343.9±27.95µs +1.95%
RegExp Literal Creation (Execution) 64.7±4.66µs 71.7±8.61µs -9.76%
RegExp Literal Creation (Full) 359.8±31.88µs 332.1±27.68µs +8.34%
Static Object Property Access (Execution) 5.1±0.53µs 5.1±0.52µs 0.00%
Static Object Property Access (Full) 274.9±27.59µs 277.2±32.27µs -0.83%
String Object Access (Execution) 6.8±0.61µs 6.9±0.68µs -1.45%
String Object Access (Full) 282.6±31.51µs 273.6±24.68µs +3.29%
String comparison (Execution) 6.3±0.48µs 6.6±0.68µs -4.55%
String comparison (Full) 499.1±143.52µs 272.9±32.00µs +82.89%
String concatenation (Execution) 5.6±0.60µs 5.7±0.63µs -1.75%
String concatenation (Full) 420.4±69.96µs 269.9±24.89µs +55.76%
String copy (Execution) 4.0±0.34µs 4.1±0.40µs -2.44%
String copy (Full) 336.0±53.69µs 277.3±32.61µs +21.17%
Symbols (Execution) 3.5±0.40µs 3.3±0.28µs +6.06%
Symbols (Full) 262.2±27.95µs 262.5±20.33µs -0.11%

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.

Looks good to me (other than the forgotten dbg!()), but it's the first time I look inside the syntax module, definitely wait for someone who knows more about it.

@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for 29b89a7

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 365.9±6.33ns 368.4±2.83ns -0.68%
Arithmetic operations (Full) 252.9±3.45µs 250.8±2.04µs +0.84%
Array access (Execution) 7.8±0.07µs 7.8±0.10µs 0.00%
Array access (Full) 275.8±2.33µs 275.1±2.70µs +0.25%
Array creation (Execution) 3.3±0.03ms 3.4±0.04ms -2.94%
Array creation (Full) 3.6±0.04ms 3.7±0.11ms -2.70%
Array pop (Execution) 1191.0±8.16µs 1204.7±14.66µs -1.14%
Array pop (Full) 1649.2±18.08µs 1708.1±63.98µs -3.45%
Boolean Object Access (Execution) 4.9±0.06µs 4.9±0.06µs 0.00%
Boolean Object Access (Full) 263.6±3.30µs 265.2±2.06µs -0.60%
Clean js (Execution) 738.1±30.22µs 722.1±11.77µs +2.22%
Clean js (Full) 1082.2±13.53µs 1046.5±11.29µs +3.41%
Clean js (Parser) 184.4±28.51µs 35.0±0.19µs +426.86%
Create Realm 464.4±19.77ns 474.1±6.28ns -2.05%
Dynamic Object Property Access (Execution) 5.5±0.08µs 5.4±0.05µs +1.85%
Dynamic Object Property Access (Full) 262.5±3.81µs 266.4±8.02µs -1.46%
Expression (Parser) 6.7±0.36µs 6.8±0.19µs -1.47%
Fibonacci (Execution) 793.0±8.89µs 806.8±13.11µs -1.71%
Fibonacci (Full) 1111.4±10.21µs 1133.6±39.08µs -1.96%
For loop (Execution) 22.0±0.24µs 21.9±0.34µs +0.46%
For loop (Full) 291.7±3.72µs 287.2±3.03µs +1.57%
For loop (Parser) 17.2±0.49µs 17.1±0.15µs +0.58%
Goal Symbols (Parser) 11.7±0.12µs 11.8±0.10µs -0.85%
Hello World (Parser) 3.0±0.11µs 3.0±0.04µs 0.00%
Long file (Parser) 756.0±10.37ns 761.4±5.22ns -0.71%
Mini js (Execution) 659.4±11.90µs 692.5±21.29µs -4.78%
Mini js (Full) 1004.3±10.28µs 957.1±5.09µs +4.93%
Mini js (Parser) 172.8±23.69µs 30.7±0.25µs +462.87%
Number Object Access (Execution) 3.9±0.07µs 3.9±0.03µs 0.00%
Number Object Access (Full) 259.5±3.21µs 262.3±3.21µs -1.07%
Object Creation (Execution) 4.7±0.13µs 4.6±0.11µs +2.17%
Object Creation (Full) 264.6±3.87µs 264.1±1.43µs +0.19%
RegExp (Execution) 63.5±1.33µs 64.8±1.55µs -2.01%
RegExp (Full) 341.4±4.85µs 344.4±5.28µs -0.87%
RegExp Literal (Execution) 66.0±1.61µs 68.3±1.29µs -3.37%
RegExp Literal (Full) 338.5±4.91µs 338.1±4.77µs +0.12%
RegExp Literal Creation (Execution) 64.4±1.18µs 64.8±1.21µs -0.62%
RegExp Literal Creation (Full) 332.5±4.63µs 338.4±4.33µs -1.74%
Static Object Property Access (Execution) 4.9±0.05µs 4.8±0.06µs +2.08%
Static Object Property Access (Full) 265.2±2.01µs 261.0±3.45µs +1.61%
String Object Access (Execution) 7.1±0.10µs 7.1±0.24µs 0.00%
String Object Access (Full) 265.2±3.87µs 269.1±1.75µs -1.45%
String comparison (Execution) 6.3±0.05µs 6.6±0.24µs -4.55%
String comparison (Full) 543.8±190.21µs 265.9±3.07µs +104.51%
String concatenation (Execution) 5.1±0.02µs 5.2±0.05µs -1.92%
String concatenation (Full) 446.2±166.32µs 259.9±3.32µs +71.68%
String copy (Execution) 3.9±0.05µs 3.9±0.11µs 0.00%
String copy (Full) 370.9±98.11µs 253.1±3.69µs +46.54%
Symbols (Execution) 3.3±0.12µs 3.2±0.04µs +3.12%
Symbols (Full) 267.2±20.59µs 261.9±10.46µs +2.02%

@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for 5b6573a

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 351.5±8.42ns 371.6±0.17ns -5.41%
Arithmetic operations (Full) 269.3±16.67µs 240.7±6.74µs +11.88%
Array access (Execution) 7.5±0.21µs 8.0±0.03µs -6.25%
Array access (Full) 279.0±0.37µs 265.0±5.26µs +5.28%
Array creation (Execution) 3.4±0.07ms 3.3±0.10ms +3.03%
Array creation (Full) 3.5±0.04ms 3.6±0.13ms -2.78%
Array pop (Execution) 1208.1±2.71µs 1155.8±36.74µs +4.53%
Array pop (Full) 1551.8±43.86µs 1678.3±7.59µs -7.54%
Boolean Object Access (Execution) 5.0±0.00µs 4.7±0.21µs +6.38%
Boolean Object Access (Full) 263.8±6.32µs 266.0±1.24µs -0.83%
Clean js (Execution) 745.2±38.84µs 740.2±5.70µs +0.68%
Clean js (Full) 1073.8±57.73µs 977.1±31.15µs +9.90%
Clean js (Parser) 36.1±0.32µs 33.3±1.12µs +8.41%
Create Realm 439.4±13.81ns 467.2±4.72ns -5.95%
Dynamic Object Property Access (Execution) 5.5±0.05µs 5.3±0.18µs +3.77%
Dynamic Object Property Access (Full) 274.6±0.73µs 257.0±7.18µs +6.85%
Expression (Parser) 6.6±0.24µs 6.7±0.08µs -1.49%
Fibonacci (Execution) 784.8±18.64µs 817.7±9.42µs -4.02%
Fibonacci (Full) 1041.9±51.01µs 1172.4±53.95µs -11.13%
For loop (Execution) 22.2±0.06µs 21.1±0.66µs +5.21%
For loop (Full) 285.4±5.58µs 288.4±0.47µs -1.04%
For loop (Parser) 17.9±1.12µs 17.2±0.03µs +4.07%
Goal Symbols (Parser) 11.6±0.24µs 11.8±0.03µs -1.69%
Hello World (Parser) 3.1±0.11µs 2.9±0.08µs +6.90%
Long file (Parser) 756.2±21.99ns 783.8±56.93ns -3.52%
Mini js (Execution) 701.2±50.60µs 632.3±23.04µs +10.90%
Mini js (Full) 934.5±14.86µs 957.4±3.78µs -2.39%
Mini js (Parser) 31.9±0.06µs 29.5±0.80µs +8.14%
Number Object Access (Execution) 3.9±0.10µs 4.0±0.13µs -2.50%
Number Object Access (Full) 270.9±1.55µs 247.3±8.71µs +9.54%
Object Creation (Execution) 4.5±0.14µs 4.7±0.05µs -4.26%
Object Creation (Full) 257.5±8.69µs 266.3±0.81µs -3.30%
RegExp (Execution) 63.5±1.73µs 63.8±1.98µs -0.47%
RegExp (Full) 353.6±4.27µs 327.4±9.43µs +8.00%
RegExp Literal (Execution) 64.4±2.17µs 68.5±1.20µs -5.99%
RegExp Literal (Full) 362.8±10.56µs 328.8±11.18µs +10.34%
RegExp Literal Creation (Execution) 67.3±3.46µs 61.4±1.89µs +9.61%
RegExp Literal Creation (Full) 338.4±5.44µs 337.4±0.81µs +0.30%
Static Object Property Access (Execution) 4.8±0.15µs 5.0±0.01µs -4.00%
Static Object Property Access (Full) 270.0±0.74µs 267.6±16.97µs +0.90%
String Object Access (Execution) 7.1±0.03µs 6.4±0.27µs +10.94%
String Object Access (Full) 267.3±6.58µs 278.1±10.33µs -3.88%
String comparison (Execution) 6.5±0.08µs 5.9±0.30µs +10.17%
String comparison (Full) 258.7±9.80µs 272.0±6.14µs -4.89%
String concatenation (Execution) 5.3±0.02µs 4.9±0.13µs +8.16%
String concatenation (Full) 262.0±14.17µs 268.3±10.54µs -2.35%
String copy (Execution) 3.8±0.11µs 4.0±0.01µs -5.00%
String copy (Full) 267.5±7.39µs 252.0±5.51µs +6.15%
Symbols (Execution) 3.3±0.06µs 3.1±0.10µs +6.45%
Symbols (Full) 253.1±6.48µs 240.0±9.19µs +5.46%

@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for 7f93367

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 400.2±16.53ns 409.2±11.99ns -2.20%
Arithmetic operations (Full) 298.7±13.68µs 293.4±9.58µs +1.81%
Array access (Execution) 9.1±0.24µs 9.0±0.39µs +1.11%
Array access (Full) 315.0±8.63µs 318.0±8.79µs -0.94%
Array creation (Execution) 3.4±0.10ms 3.3±0.06ms +3.03%
Array creation (Full) 3.8±0.11ms 3.6±0.10ms +5.56%
Array pop (Execution) 1184.6±46.25µs 1195.1±41.35µs -0.88%
Array pop (Full) 1795.2±145.94µs 1737.9±108.83µs +3.30%
Boolean Object Access (Execution) 5.6±0.21µs 5.6±0.21µs 0.00%
Boolean Object Access (Full) 300.2±14.18µs 306.5±9.86µs -2.06%
Clean js (Execution) 805.7±28.39µs 804.0±20.23µs +0.21%
Clean js (Full) 1153.6±59.67µs 1136.7±49.63µs +1.49%
Clean js (Parser) 40.5±0.94µs 40.7±3.05µs -0.49%
Create Realm 489.6±22.01ns 502.6±21.78ns -2.59%
Dynamic Object Property Access (Execution) 6.4±0.23µs 6.4±0.21µs 0.00%
Dynamic Object Property Access (Full) 326.4±11.75µs 311.0±17.40µs +4.95%
Expression (Parser) 7.4±0.60µs 7.4±0.19µs 0.00%
Fibonacci (Execution) 985.3±28.17µs 975.3±28.62µs +1.03%
Fibonacci (Full) 1329.9±28.95µs 1334.8±41.12µs -0.37%
For loop (Execution) 25.3±1.32µs 25.3±1.24µs 0.00%
For loop (Full) 339.7±11.04µs 329.5±10.76µs +3.10%
For loop (Parser) 19.7±0.75µs 19.2±0.52µs +2.60%
Goal Symbols (Parser) 13.3±0.59µs 13.0±0.35µs +2.31%
Hello World (Parser) 3.5±0.10µs 3.4±0.13µs +2.94%
Long file (Parser) 841.9±24.08ns 839.7±42.40ns +0.26%
Mini js (Execution) 714.2±23.90µs 724.0±25.20µs -1.35%
Mini js (Full) 1054.0±32.21µs 1035.7±38.74µs +1.77%
Mini js (Parser) 36.4±1.58µs 35.2±1.23µs +3.41%
Number Object Access (Execution) 4.4±0.15µs 4.3±0.11µs +2.33%
Number Object Access (Full) 301.8±9.79µs 300.3±7.85µs +0.50%
Object Creation (Execution) 5.5±0.20µs 5.6±0.19µs -1.79%
Object Creation (Full) 309.7±10.23µs 308.5±9.96µs +0.39%
RegExp (Execution) 74.1±3.60µs 73.5±2.48µs +0.82%
RegExp (Full) 398.3±19.25µs 399.2±19.92µs -0.23%
RegExp Literal (Execution) 78.7±5.15µs 80.0±12.58µs -1.63%
RegExp Literal (Full) 390.1±8.48µs 390.5±10.41µs -0.10%
RegExp Literal Creation (Execution) 74.2±2.78µs 74.1±2.49µs +0.13%
RegExp Literal Creation (Full) 404.1±16.57µs 389.5±12.66µs +3.75%
Static Object Property Access (Execution) 5.8±0.14µs 5.8±0.18µs 0.00%
Static Object Property Access (Full) 312.4±13.01µs 310.6±13.75µs +0.58%
String Object Access (Execution) 8.0±0.28µs 7.8±0.22µs +2.56%
String Object Access (Full) 311.2±8.93µs 307.2±8.40µs +1.30%
String comparison (Execution) 7.2±0.24µs 7.2±0.27µs 0.00%
String comparison (Full) 309.2±22.46µs 311.6±7.80µs -0.77%
String concatenation (Execution) 6.0±0.19µs 5.8±0.18µs +3.45%
String concatenation (Full) 302.5±7.54µs 305.4±14.59µs -0.95%
String copy (Execution) 4.6±0.20µs 4.5±0.15µs +2.22%
String copy (Full) 303.1±9.20µs 295.4±8.74µs +2.61%
Symbols (Execution) 3.8±0.10µs 3.8±0.14µs 0.00%
Symbols (Full) 289.9±12.03µs 290.8±11.35µs -0.31%

@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for 85d8289

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 394.1±22.39ns 378.7±4.59ns +4.07%
Arithmetic operations (Full) 274.5±9.02µs 274.1±10.74µs +0.15%
Array access (Execution) 8.4±0.25µs 8.5±0.28µs -1.18%
Array access (Full) 304.1±10.86µs 296.3±7.80µs +2.63%
Array creation (Execution) 3.6±0.17ms 3.6±0.06ms 0.00%
Array creation (Full) 3.7±0.12ms 3.9±0.10ms -5.13%
Array pop (Execution) 1299.9±44.83µs 1293.3±55.16µs +0.51%
Array pop (Full) 1712.0±37.44µs 1781.7±61.99µs -3.91%
Boolean Object Access (Execution) 5.3±0.30µs 5.2±0.14µs +1.92%
Boolean Object Access (Full) 288.6±10.63µs 288.2±7.71µs +0.14%
Clean js (Execution) 800.3±27.41µs 800.6±30.00µs -0.04%
Clean js (Full) 1117.5±41.29µs 1110.5±32.42µs +0.63%
Clean js (Parser) 37.5±0.76µs 37.3±0.89µs +0.54%
Create Realm 478.5±12.93ns 486.2±14.75ns -1.58%
Dynamic Object Property Access (Execution) 5.9±0.24µs 5.9±0.17µs 0.00%
Dynamic Object Property Access (Full) 296.4±8.79µs 295.3±23.03µs +0.37%
Expression (Parser) 7.0±0.24µs 7.4±0.27µs -5.41%
Fibonacci (Execution) 867.5±22.69µs 887.1±42.49µs -2.21%
Fibonacci (Full) 1197.4±42.70µs 1184.2±50.59µs +1.11%
For loop (Execution) 23.8±0.91µs 24.0±0.98µs -0.83%
For loop (Full) 316.8±15.19µs 316.3±15.08µs +0.16%
For loop (Parser) 18.4±0.51µs 18.3±0.58µs +0.55%
Goal Symbols (Parser) 12.6±0.33µs 12.4±0.44µs +1.61%
Hello World (Parser) 3.2±0.11µs 3.3±0.18µs -3.03%
Long file (Parser) 799.0±18.97ns 797.3±28.35ns +0.21%
Mini js (Execution) 720.8±18.48µs 722.2±16.12µs -0.19%
Mini js (Full) 1023.3±27.51µs 1030.8±37.77µs -0.73%
Mini js (Parser) 32.9±0.54µs 32.8±1.33µs +0.30%
Number Object Access (Execution) 4.2±0.14µs 4.3±0.37µs -2.33%
Number Object Access (Full) 288.8±9.24µs 284.0±8.13µs +1.69%
Object Creation (Execution) 5.0±0.18µs 4.9±0.13µs +2.04%
Object Creation (Full) 290.8±8.25µs 286.5±7.84µs +1.50%
RegExp (Execution) 69.6±2.96µs 71.0±5.27µs -1.97%
RegExp (Full) 392.9±84.19µs 374.1±12.92µs +5.03%
RegExp Literal (Execution) 73.4±3.72µs 72.7±2.64µs +0.96%
RegExp Literal (Full) 384.8±24.36µs 380.4±14.64µs +1.16%
RegExp Literal Creation (Execution) 69.6±2.37µs 69.4±2.54µs +0.29%
RegExp Literal Creation (Full) 381.1±37.71µs 359.7±11.98µs +5.95%
Static Object Property Access (Execution) 5.4±0.39µs 5.2±0.13µs +3.85%
Static Object Property Access (Full) 292.7±11.73µs 284.3±14.06µs +2.95%
String Object Access (Execution) 7.6±0.26µs 7.6±0.45µs 0.00%
String Object Access (Full) 297.9±9.07µs 292.0±8.41µs +2.02%
String comparison (Execution) 6.8±0.23µs 6.9±0.41µs -1.45%
String comparison (Full) 296.5±8.99µs 288.3±7.67µs +2.84%
String concatenation (Execution) 5.7±0.20µs 5.6±0.17µs +1.79%
String concatenation (Full) 293.1±11.95µs 281.7±10.67µs +4.05%
String copy (Execution) 4.2±0.31µs 4.2±0.17µs 0.00%
String copy (Full) 283.8±6.54µs 275.5±6.83µs +3.01%
Symbols (Execution) 3.5±0.12µs 3.5±0.09µs 0.00%
Symbols (Full) 278.6±12.45µs 275.5±8.57µs +1.13%

Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

Looks perfect to me!

@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for 9bd3421

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 278.3±15.66ns 276.7±12.11ns +0.58%
Arithmetic operations (Full) 190.4±8.72µs 190.2±8.60µs +0.11%
Array access (Execution) 6.0±0.34µs 5.9±0.22µs +1.69%
Array access (Full) 205.5±8.19µs 208.8±13.10µs -1.58%
Array creation (Execution) 2.4±0.12ms 2.6±0.15ms -7.69%
Array creation (Full) 2.6±0.12ms 2.7±0.10ms -3.70%
Array pop (Execution) 825.1±30.18µs 927.4±40.06µs -11.03%
Array pop (Full) 1195.2±56.30µs 1241.6±49.17µs -3.74%
Boolean Object Access (Execution) 3.8±0.23µs 3.7±0.22µs +2.70%
Boolean Object Access (Full) 197.6±6.43µs 196.7±8.75µs +0.46%
Clean js (Execution) 544.8±30.97µs 561.8±30.98µs -3.03%
Clean js (Full) 774.6±35.73µs 791.0±39.28µs -2.07%
Clean js (Parser) 27.4±1.56µs 26.0±1.11µs +5.38%
Create Realm 353.5±17.85ns 351.6±14.70ns +0.54%
Dynamic Object Property Access (Execution) 4.2±0.22µs 4.1±0.15µs +2.44%
Dynamic Object Property Access (Full) 202.2±10.54µs 200.3±9.66µs +0.95%
Expression (Parser) 4.9±0.26µs 5.1±0.25µs -3.92%
Fibonacci (Execution) 619.0±30.04µs 609.5±27.18µs +1.56%
Fibonacci (Full) 829.4±30.19µs 864.0±62.68µs -4.00%
For loop (Execution) 17.3±1.34µs 16.6±0.79µs +4.22%
For loop (Full) 217.9±9.22µs 217.1±12.63µs +0.37%
For loop (Parser) 12.9±0.69µs 12.8±0.57µs +0.78%
Goal Symbols (Parser) 9.1±0.63µs 8.7±0.36µs +4.60%
Hello World (Parser) 2.2±0.11µs 2.3±0.11µs -4.35%
Long file (Parser) 581.5±22.68ns 577.8±23.46ns +0.64%
Mini js (Execution) 488.6±20.41µs 496.4±20.02µs -1.57%
Mini js (Full) 706.1±28.23µs 728.2±40.46µs -3.03%
Mini js (Parser) 23.4±1.09µs 22.9±1.00µs +2.18%
Number Object Access (Execution) 3.0±0.13µs 2.9±0.18µs +3.45%
Number Object Access (Full) 194.6±6.46µs 197.4±8.01µs -1.42%
Object Creation (Execution) 3.5±0.17µs 3.5±0.17µs 0.00%
Object Creation (Full) 198.4±8.84µs 200.7±9.78µs -1.15%
RegExp (Execution) 49.1±2.47µs 48.9±2.27µs +0.41%
RegExp (Full) 264.5±14.33µs 262.6±14.91µs +0.72%
RegExp Literal (Execution) 51.5±2.20µs 51.9±2.82µs -0.77%
RegExp Literal (Full) 258.2±11.73µs 259.1±10.37µs -0.35%
RegExp Literal Creation (Execution) 49.1±3.44µs 50.1±4.21µs -2.00%
RegExp Literal Creation (Full) 256.9±16.50µs 253.3±11.99µs +1.42%
Static Object Property Access (Execution) 3.7±0.20µs 3.7±0.26µs 0.00%
Static Object Property Access (Full) 199.4±10.90µs 197.7±10.79µs +0.86%
String Object Access (Execution) 5.4±0.27µs 5.4±0.24µs 0.00%
String Object Access (Full) 201.0±11.11µs 202.6±9.27µs -0.79%
String comparison (Execution) 4.8±0.23µs 4.7±0.21µs +2.13%
String comparison (Full) 200.9±9.00µs 200.9±7.78µs 0.00%
String concatenation (Execution) 3.9±0.13µs 3.9±0.18µs 0.00%
String concatenation (Full) 198.6±9.99µs 195.8±9.46µs +1.43%
String copy (Execution) 3.0±0.17µs 2.9±0.13µs +3.45%
String copy (Full) 193.1±8.19µs 193.7±8.09µs -0.31%
Symbols (Execution) 2.5±0.13µs 2.5±0.12µs 0.00%
Symbols (Full) 196.9±11.43µs 189.5±8.09µs +3.91%

@github-actions
Copy link

github-actions bot commented Oct 4, 2020

Benchmark for 2fcff9a

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 386.1±19.47ns 375.1±27.81ns +2.93%
Arithmetic operations (Full) 280.4±24.47µs 263.2±15.27µs +6.53%
Array access (Execution) 8.6±0.53µs 8.6±0.48µs 0.00%
Array access (Full) 296.6±21.26µs 297.0±22.68µs -0.13%
Array creation (Execution) 3.2±0.18ms 3.2±0.24ms 0.00%
Array creation (Full) 3.6±0.27ms 3.5±0.15ms +2.86%
Array pop (Execution) 1114.6±80.75µs 1118.3±80.46µs -0.33%
Array pop (Full) 1709.0±230.97µs 1577.2±89.91µs +8.36%
Boolean Object Access (Execution) 5.2±0.27µs 5.2±0.32µs 0.00%
Boolean Object Access (Full) 281.6±20.11µs 289.8±15.71µs -2.83%
Clean js (Execution) 723.2±53.27µs 725.7±50.76µs -0.34%
Clean js (Full) 1091.6±71.08µs 1079.9±77.74µs +1.08%
Clean js (Parser) 38.7±3.88µs 37.7±1.98µs +2.65%
Create Realm 460.1±35.87ns 457.3±35.38ns +0.61%
Dynamic Object Property Access (Execution) 6.1±0.42µs 6.0±0.39µs +1.67%
Dynamic Object Property Access (Full) 284.7±15.23µs 287.9±29.24µs -1.11%
Expression (Parser) 6.8±0.38µs 6.9±0.44µs -1.45%
Fibonacci (Execution) 960.3±57.53µs 951.1±42.14µs +0.97%
Fibonacci (Full) 1281.4±77.37µs 1267.1±79.69µs +1.13%
For loop (Execution) 23.7±1.40µs 23.2±1.36µs +2.16%
For loop (Full) 318.2±22.55µs 318.2±19.75µs 0.00%
For loop (Parser) 18.2±1.20µs 18.1±1.14µs +0.55%
Goal Symbols (Parser) 12.2±0.87µs 12.1±0.76µs +0.83%
Hello World (Parser) 3.2±0.17µs 3.3±0.23µs -3.03%
Long file (Parser) 782.9±76.22ns 781.4±40.15ns +0.19%
Mini js (Execution) 668.9±39.67µs 653.1±37.53µs +2.42%
Mini js (Full) 992.7±101.17µs 965.6±55.94µs +2.81%
Mini js (Parser) 33.0±2.41µs 33.4±1.68µs -1.20%
Number Object Access (Execution) 4.2±0.42µs 4.0±0.26µs +5.00%
Number Object Access (Full) 279.4±19.01µs 286.0±17.73µs -2.31%
Object Creation (Execution) 5.4±0.35µs 5.1±0.31µs +5.88%
Object Creation (Full) 290.0±14.40µs 286.3±16.96µs +1.29%
RegExp (Execution) 69.9±3.81µs 68.5±3.73µs +2.04%
RegExp (Full) 381.1±48.31µs 372.4±27.60µs +2.34%
RegExp Literal (Execution) 73.5±4.58µs 74.8±3.72µs -1.74%
RegExp Literal (Full) 365.1±20.53µs 364.8±23.43µs +0.08%
RegExp Literal Creation (Execution) 70.6±10.76µs 68.4±5.76µs +3.22%
RegExp Literal Creation (Full) 378.2±21.83µs 369.7±36.50µs +2.30%
Static Object Property Access (Execution) 5.4±0.29µs 5.3±0.26µs +1.89%
Static Object Property Access (Full) 285.6±19.74µs 293.5±13.82µs -2.69%
String Object Access (Execution) 7.5±0.62µs 7.4±0.60µs +1.35%
String Object Access (Full) 291.0±14.20µs 282.6±17.00µs +2.97%
String comparison (Execution) 7.0±0.43µs 6.7±0.41µs +4.48%
String comparison (Full) 293.8±17.02µs 292.6±28.95µs +0.41%
String concatenation (Execution) 5.8±0.40µs 5.7±0.34µs +1.75%
String concatenation (Full) 293.0±26.29µs 279.4±16.16µs +4.87%
String copy (Execution) 4.4±0.25µs 4.2±0.27µs +4.76%
String copy (Full) 277.9±14.87µs 273.0±17.13µs +1.79%
Symbols (Execution) 3.7±0.20µs 3.5±0.20µs +5.71%
Symbols (Full) 275.7±18.44µs 277.3±48.62µs -0.58%

@HalidOdat HalidOdat added enhancement New feature or request lexer Issues surrounding the lexer parser Issues surrounding the parser labels Oct 4, 2020
@HalidOdat HalidOdat added this to the v0.11.0 milestone Oct 4, 2020
@Lan2u Lan2u merged commit 6bcfc7a into master Oct 5, 2020
@Lan2u Lan2u deleted the strict_parse_lex branch October 5, 2020 18:11
@Lan2u Lan2u mentioned this pull request Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lexer Issues surrounding the lexer parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strict Mode Lex/Parse
4 participants