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

label statement implementation #549

Merged
merged 20 commits into from
Sep 28, 2020
Merged

label statement implementation #549

merged 20 commits into from
Sep 28, 2020

Conversation

jasonwilliams
Copy link
Member

@jasonwilliams jasonwilliams commented Jul 5, 2020

fixes #549

@Razican it looks like the Statement parse will need to be passed an optional label argument which then is also passed into all of the sub statements, what do you think?

Also what is the Output type for labelled Statement? As it technically, it is allowed to wrap any statement I think this could be Node

Try with

let str = "";

loop1: for (let i = 0; i < 5; i++) {
  loop2: for (let b = 0; b < 5; b++) {
    if (b === 2) {
      break loop1;
    }
    str = str + b;
  }
  console.log("never reaches here");
  str = str + i;
}

console.log(str);
// expected output: "01

@github-actions
Copy link

github-actions bot commented Jul 5, 2020

Benchmark for b88e16a

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 407.9±20.22ns 431.7±21.60ns -5.51%
Array access (Execution) 14.3±0.57µs 16.0±1.55µs -10.62%
Array creation (Execution) 3.7±0.15ms 4.0±0.15ms -7.50%
Array pop (Execution) 1399.7±55.31µs 1450.0±59.64µs -3.47%
Boolean Object Access (Execution) 5.6±0.27µs 5.6±0.34µs 0.00%
Create Realm 154.6±7.00µs 186.3±10.57µs -17.02%
Dynamic Object Property Access (Execution) 7.6±0.57µs 7.8±0.63µs -2.56%
Expression (Lexer) 2.1±0.12µs 2.2±0.11µs -4.55%
Expression (Parser) 6.5±0.92µs 5.0±0.34µs +30.00%
Fibonacci (Execution) 1100.6±48.36µs 1342.0±157.15µs -17.99%
For loop (Execution) 23.9±1.26µs 28.7±2.67µs -16.72%
For loop (Lexer) 5.5±0.41µs 5.4±0.27µs +1.85%
For loop (Parser) 18.5±1.51µs 14.4±0.53µs +28.47%
Hello World (Lexer) 955.8±43.27ns 985.2±57.95ns -2.98%
Hello World (Parser) 2.9±0.16µs 2.2±0.09µs +31.82%
Long file (Parser) 8.0±0.38ms 6.5±0.29ms +23.08%
Number Object Access (Execution) 4.2±0.20µs 4.4±0.20µs -4.55%
Object Creation (Execution) 6.5±0.33µs 6.8±0.36µs -4.41%
RegExp (Execution) 78.8±4.29µs 81.6±3.31µs -3.43%
RegExp Literal (Execution) 83.4±4.30µs 85.6±3.50µs -2.57%
RegExp Literal Creation (Execution) 78.6±3.84µs 82.0±2.78µs -4.15%
Static Object Property Access (Execution) 6.8±0.31µs 6.9±0.30µs -1.45%
String Object Access (Execution) 9.6±0.40µs 9.5±0.39µs +1.05%
String comparison (Execution) 7.8±0.56µs 7.5±0.33µs +4.00%
String concatenation (Execution) 6.5±0.24µs 6.4±0.22µs +1.56%
String copy (Execution) 5.1±0.22µs 5.1±0.22µs 0.00%
Symbols (Execution) 4.3±0.27µs 5.2±0.41µs -17.31%

@jasonwilliams jasonwilliams changed the title start on label label statement implementation Jul 5, 2020
@codecov
Copy link

codecov bot commented Jul 5, 2020

Codecov Report

Merging #549 into master will decrease coverage by 0.03%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #549      +/-   ##
==========================================
- Coverage   71.78%   71.74%   -0.04%     
==========================================
  Files         199      200       +1     
  Lines       13943    13980      +37     
==========================================
+ Hits        10009    10030      +21     
- Misses       3934     3950      +16     
Impacted Files Coverage Δ
boa/src/exec/mod.rs 85.41% <ø> (ø)
boa/src/exec/tests.rs 100.00% <ø> (ø)
boa/src/syntax/parser/statement/mod.rs 56.42% <57.14%> (-0.72%) ⬇️
boa/src/exec/iteration/mod.rs 58.20% <75.00%> (-2.36%) ⬇️
boa/src/syntax/ast/node/iteration.rs 61.79% <75.00%> (+1.30%) ⬆️
...oa/src/syntax/parser/statement/labelled_stm/mod.rs 86.66% <86.66%> (ø)
boa/src/exec/break_node/mod.rs 100.00% <100.00%> (ø)
boa/src/exec/break_node/tests.rs 100.00% <100.00%> (ø)
boa/src/exec/iteration/tests.rs 100.00% <100.00%> (ø)
boa/src/syntax/parser/error.rs 24.19% <0.00%> (-6.46%) ⬇️
... and 8 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 01b5cec...2af99be. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jul 5, 2020

Benchmark for fc915c7

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 364.3±20.85ns 318.7±14.93ns +14.31%
Array access (Execution) 12.9±0.70µs 12.9±0.66µs 0.00%
Array creation (Execution) 3.4±0.13ms 3.3±0.11ms +3.03%
Array pop (Execution) 1253.7±88.20µs 1265.2±68.69µs -0.91%
Boolean Object Access (Execution) 4.9±0.25µs 4.4±0.23µs +11.36%
Create Realm 142.6±5.96µs 137.8±7.42µs +3.48%
Dynamic Object Property Access (Execution) 6.7±0.38µs 6.3±0.62µs +6.35%
Expression (Lexer) 1924.6±104.34ns 1706.7±95.84ns +12.77%
Expression (Parser) 4.5±0.25µs 3.8±0.17µs +18.42%
Fibonacci (Execution) 1016.1±55.21µs 995.3±56.99µs +2.09%
For loop (Execution) 21.9±1.45µs 21.5±1.17µs +1.86%
For loop (Lexer) 4.8±0.31µs 4.2±0.28µs +14.29%
For loop (Parser) 13.7±1.03µs 11.0±0.59µs +24.55%
Hello World (Lexer) 890.0±96.36ns 765.0±37.67ns +16.34%
Hello World (Parser) 2.0±0.10µs 1748.0±77.07ns +14.42%
Long file (Parser) 5.9±0.22ms 5.0±0.16ms +18.00%
Number Object Access (Execution) 3.8±0.20µs 3.6±0.29µs +5.56%
Object Creation (Execution) 6.0±0.30µs 6.0±0.37µs 0.00%
RegExp (Execution) 72.1±2.76µs 64.3±5.21µs +12.13%
RegExp Literal (Execution) 75.5±4.16µs 68.4±4.64µs +10.38%
RegExp Literal Creation (Execution) 70.5±3.68µs 63.1±3.93µs +11.73%
Static Object Property Access (Execution) 6.1±0.33µs 6.2±0.47µs -1.61%
String Object Access (Execution) 8.2±0.54µs 7.4±0.39µs +10.81%
String comparison (Execution) 6.7±0.36µs 5.8±0.25µs +15.52%
String concatenation (Execution) 5.7±0.43µs 4.9±0.41µs +16.33%
String copy (Execution) 4.6±0.24µs 3.9±0.16µs +17.95%
Symbols (Execution) 4.2±0.25µs 3.9±0.22µs +7.69%

@Razican
Copy link
Member

Razican commented Jul 6, 2020

@Razican it looks like the Statement parse will need to be passed an optional label argument which then is also passed into all of the sub statements, what do you think?

I think we should have a LabeledStatement AST node, that would contain a Box<str> as the label, and a Node as the statement. This would allow not having to pass this label to all the sub statements. If we are parsing a labeled statement, we take the label and store it in a string, then we parse the statement as we did before, and get the Node.

Also what is the Output type for labelled Statement? As it technically, it is allowed to wrap any statement I think this could be Node

I think it should be the LabeledStatement type I explained above.

/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label
/// [spec]: https://tc39.es/ecma262/#sec-labelled-statements
#[derive(Debug, Clone, Copy)]
pub(super) struct Label {
Copy link
Member

Choose a reason for hiding this comment

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

I would keep the name of the LabelledStatement as in the spec. This parser would return a LabelledStatement node, with a label and a Node.

@Razican Razican mentioned this pull request Jul 7, 2020
@github-actions
Copy link

Benchmark for c3c395c

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 375.5±18.47ns 424.7±30.58ns -11.58%
Arithmetic operations (Full) 177.6±6.51µs 175.3±8.88µs +1.31%
Array access (Execution) 15.6±0.98µs 15.5±0.79µs +0.65%
Array access (Full) 207.8±7.67µs 200.8±9.54µs +3.49%
Array creation (Execution) 3.8±0.13ms 3.7±0.15ms +2.70%
Array creation (Full) 4.2±0.11ms 4.1±0.15ms +2.44%
Array pop (Execution) 1461.1±45.19µs 1496.6±77.72µs -2.37%
Array pop (Full) 1864.7±109.53µs 1800.6±91.43µs +3.56%
Boolean Object Access (Execution) 5.7±0.34µs 5.5±0.22µs +3.64%
Boolean Object Access (Full) 190.7±9.90µs 189.2±8.13µs +0.79%
Create Realm 164.8±6.31µs 157.8±7.42µs +4.44%
Dynamic Object Property Access (Execution) 7.8±0.30µs 7.9±0.38µs -1.27%
Dynamic Object Property Access (Full) 194.8±7.73µs 192.9±14.34µs +0.98%
Expression (Lexer) 2.5±0.11µs 2.5±0.19µs 0.00%
Expression (Parser) 5.5±0.36µs 5.5±0.27µs 0.00%
Fibonacci (Execution) 1144.1±40.01µs 1134.8±61.34µs +0.82%
Fibonacci (Full) 1342.1±81.98µs 1307.1±71.71µs +2.68%
For loop (Execution) 24.6±0.93µs 23.9±1.28µs +2.93%
For loop (Full) 213.8±9.71µs 201.8±10.84µs +5.95%
For loop (Lexer) 5.7±0.24µs 5.3±0.24µs +7.55%
For loop (Parser) 14.5±0.70µs 14.3±0.62µs +1.40%
Goal Symbols (Parser) 8.6±0.39µs 8.7±0.64µs -1.15%
Hello World (Lexer) 859.8±33.41ns 850.3±41.60ns +1.12%
Hello World (Parser) 2.2±0.17µs 2.2±0.10µs 0.00%
Long file (Parser) 6.6±0.22ms 6.5±0.20ms +1.54%
Number Object Access (Execution) 4.5±0.21µs 4.2±0.26µs +7.14%
Number Object Access (Full) 228.5±8.99µs 226.4±10.42µs +0.93%
Object Creation (Execution) 6.9±0.30µs 6.9±0.36µs 0.00%
Object Creation (Full) 211.7±9.09µs 206.0±10.37µs +2.77%
RegExp (Execution) 73.3±2.83µs 71.3±4.81µs +2.81%
RegExp (Full) 318.3±17.18µs 321.2±20.69µs -0.90%
RegExp Literal (Execution) 79.0±3.32µs 76.3±5.42µs +3.54%
RegExp Literal (Full) 279.3±18.41µs 275.9±16.09µs +1.23%
RegExp Literal Creation (Execution) 74.4±4.40µs 71.9±3.41µs +3.48%
RegExp Literal Creation (Full) 313.8±11.76µs 306.1±18.58µs +2.52%
Static Object Property Access (Execution) 7.4±0.37µs 7.2±0.35µs +2.78%
Static Object Property Access (Full) 191.0±7.36µs 189.8±10.18µs +0.63%
String Object Access (Execution) 9.6±0.33µs 9.3±0.38µs +3.23%
String Object Access (Full) 195.9±11.58µs 193.1±9.82µs +1.45%
String comparison (Execution) 8.1±0.54µs 7.4±0.38µs +9.46%
String comparison (Full) 190.2±9.63µs 193.3±11.97µs -1.60%
String concatenation (Execution) 6.7±0.25µs 6.3±0.35µs +6.35%
String concatenation (Full) 188.7±8.63µs 185.6±10.97µs +1.67%
String copy (Execution) 5.5±0.31µs 5.1±0.24µs +7.84%
String copy (Full) 182.9±6.33µs 182.9±9.16µs 0.00%
Symbols (Execution) 4.7±0.26µs 4.5±0.14µs +4.44%
Symbols (Full) 174.5±7.53µs 172.3±7.53µs +1.28%

@jasonwilliams
Copy link
Member Author

jasonwilliams commented Jul 19, 2020

@Razican i can't think of how we would do this without either passing a label into the run method, but that would mean changing the interface for all Execution, or passing the label when Label creates a statement (sub node) https://github.com/jasonwilliams/boa/blob/feature/548/boa/src/syntax/parser/statement/labelled_stm/mod.rs#L49

However we do this we need to access the label here

@jasonwilliams jasonwilliams added this to the v0.10.0 milestone Jul 19, 2020
@jasonwilliams
Copy link
Member Author

jasonwilliams commented Aug 22, 2020

I've had another look at this, and i think we could have a stack for labels on the Interpreter struct, we can then push and pop them as we come across the Label AST node and the Break AST nodes respectively

Then the break operation can check against the top label on the stack.

Edit:
I think we can just set label on the forLoop before we run it inside of Label::run()

Edit:
May have to implement set_label for node and have it only do something if the node is a forLoop

@jcdickinson
Copy link
Contributor

A much simpler implementation would be to add the label to the loop statement AST nodes. Then, the loops can simply:

InterpreterState::Break(label) => {
    // Loops 'consume' breaks, only if the label is not present, or does not match the current loop.
    match label {
        None => interpreter.set_current_state(InterpreterState::Executing),
        Some(_) if label == self.label() => interpreter.set_current_state(InterpreterState::Executing),
        _ => {}
    }
    break;
}
// ... Likewise for Continue.

I'm pretty certain that would work. This uses the native/Rust stack as the label stack, completely avoiding that allocation. Obviously, this allows invalid JS:

label1: while(true) {
  break label2;
}

So the validity of labels would need to be checked in the parser.

@Razican
Copy link
Member

Razican commented Aug 31, 2020

The issue with this approach is that it only allows labelled loops, but, functions and other statements can also have a label: https://tc39.es/ecma262/#sec-labelled-statements

@jasonwilliams
Copy link
Member Author

jasonwilliams commented Aug 31, 2020

The direction I’ve gone in is that Nodes which currently use a label will have a label property and use it as needed. So not too different from your example.
During parsing the label_statement will set the label on that node and return that node.

If we can set the label on the statement then there’s no need for a label node during execution, also if we need to add labels to new nodes in future it will be easy.

If a Node doesn’t need a label it’s basically a noop and that statement is just returned “as-is”. This is achieved by matching on a node and calling set_label on the ones that can.

It can’t be set at execution time because the Node is in a “read-only” state at this point (we can only run it)

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.

After the last comment, I thought we would have stuff such as an Option<Box<str>> for a label in some nodes, but the code here still has a Label node. I did a review with some comments though.

I do like the idea of having an optional label in the statements that allow it, that would make everything easier, and I don't think it will grow memory usage too much.

boa/src/syntax/ast/node/labelled_smt.rs Outdated Show resolved Hide resolved
boa/src/syntax/ast/node/mod.rs Outdated Show resolved Hide resolved
boa/src/syntax/parser/statement/iteration/for_statement.rs Outdated Show resolved Hide resolved
boa/src/syntax/ast/node/labelled_smt.rs Outdated Show resolved Hide resolved
@jasonwilliams jasonwilliams marked this pull request as ready for review September 20, 2020 17:35
@jasonwilliams
Copy link
Member Author

jasonwilliams commented Sep 20, 2020

Label Node is no longer needed.
Instead Labelled_stmt sets the label on the stmt during parsing, then returns that Node.

Then execution steps remains as it was before (no change there).

Label can't set the label as a Node during exec because that would require the node to be mutable and would require changing all of the traits we have for exec.

@github-actions
Copy link

Benchmark for 46c28ba

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 402.8±3.87ns 387.9±11.85ns +3.84%
Arithmetic operations (Full) 274.2±5.00µs 275.9±7.10µs -0.62%
Array access (Execution) 9.0±0.20µs 9.1±0.28µs -1.10%
Array access (Full) 303.4±9.81µs 302.0±3.93µs +0.46%
Array creation (Execution) 3.3±0.05ms 3.5±0.04ms -5.71%
Array creation (Full) 3.8±0.10ms 3.8±0.06ms 0.00%
Array pop (Execution) 1161.3±20.36µs 1229.1±24.78µs -5.52%
Array pop (Full) 1741.6±40.91µs 1740.6±49.10µs +0.06%
Boolean Object Access (Execution) 5.3±0.10µs 5.2±0.07µs +1.92%
Boolean Object Access (Full) 291.4±4.98µs 289.0±3.82µs +0.83%
Clean js (Execution) 778.5±18.87µs 805.9±79.40µs -3.40%
Clean js (Full) 1116.2±27.84µs 1120.9±28.52µs -0.42%
Clean js (Parser) 40.0±0.72µs 40.0±1.36µs 0.00%
Create Realm 496.7±7.08ns 496.3±8.26ns +0.08%
Dynamic Object Property Access (Execution) 6.0±0.07µs 6.1±0.15µs -1.64%
Dynamic Object Property Access (Full) 295.7±7.45µs 294.6±10.20µs +0.37%
Expression (Parser) 7.0±0.09µs 7.3±0.13µs -4.11%
Fibonacci (Execution) 970.8±20.44µs 973.6±21.78µs -0.29%
Fibonacci (Full) 1266.6±26.97µs 1248.1±26.26µs +1.48%
For loop (Execution) 24.7±0.46µs 24.8±0.42µs -0.40%
For loop (Full) 315.5±8.23µs 318.1±8.78µs -0.82%
For loop (Parser) 19.2±0.28µs 19.0±0.23µs +1.05%
Goal Symbols (Parser) 12.8±0.32µs 12.8±0.21µs 0.00%
Hello World (Parser) 3.3±0.07µs 3.3±0.15µs 0.00%
Long file (Parser) 850.5±33.03ns 844.4±55.18ns +0.72%
Mini js (Execution) 699.2±9.39µs 717.9±10.84µs -2.60%
Mini js (Full) 1032.5±26.92µs 1033.6±37.84µs -0.11%
Mini js (Parser) 35.4±0.82µs 35.1±0.74µs +0.85%
Number Object Access (Execution) 4.2±0.29µs 4.1±0.07µs +2.44%
Number Object Access (Full) 289.4±10.18µs 285.9±8.08µs +1.22%
Object Creation (Execution) 5.1±0.10µs 5.2±0.18µs -1.92%
Object Creation (Full) 290.5±8.10µs 290.9±7.86µs -0.14%
RegExp (Execution) 72.7±1.69µs 73.0±2.27µs -0.41%
RegExp (Full) 377.5±9.83µs 378.7±20.39µs -0.32%
RegExp Literal (Execution) 76.8±3.46µs 76.9±3.35µs -0.13%
RegExp Literal (Full) 370.7±7.53µs 372.5±6.31µs -0.48%
RegExp Literal Creation (Execution) 72.4±1.47µs 73.0±2.16µs -0.82%
RegExp Literal Creation (Full) 366.3±15.54µs 365.3±10.77µs +0.27%
Static Object Property Access (Execution) 5.5±0.22µs 5.5±0.08µs 0.00%
Static Object Property Access (Full) 289.5±7.38µs 291.0±15.77µs -0.52%
String Object Access (Execution) 7.7±0.13µs 7.7±0.10µs 0.00%
String Object Access (Full) 291.6±4.93µs 292.5±8.78µs -0.31%
String comparison (Execution) 7.0±0.16µs 7.1±0.11µs -1.41%
String comparison (Full) 291.5±4.79µs 292.8±5.18µs -0.44%
String concatenation (Execution) 5.9±0.55µs 5.9±0.21µs 0.00%
String concatenation (Full) 285.5±11.68µs 287.6±3.86µs -0.73%
String copy (Execution) 4.4±0.13µs 4.4±0.09µs 0.00%
String copy (Full) 283.4±11.02µs 285.0±10.45µs -0.56%
Symbols (Execution) 3.5±0.06µs 3.7±0.08µs -5.41%
Symbols (Full) 262.8±4.83µs 262.1±5.73µs +0.27%

@github-actions
Copy link

Benchmark for 23e37bd

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 369.4±16.06ns 395.7±15.30ns -6.65%
Arithmetic operations (Full) 264.2±14.37µs 271.6±25.38µs -2.72%
Array access (Execution) 8.6±0.76µs 8.7±0.39µs -1.15%
Array access (Full) 294.2±12.08µs 283.7±11.67µs +3.70%
Array creation (Execution) 3.2±0.10ms 3.3±0.09ms -3.03%
Array creation (Full) 3.5±0.11ms 3.6±0.14ms -2.78%
Array pop (Execution) 1105.1±58.19µs 1158.7±42.99µs -4.63%
Array pop (Full) 1635.5±54.73µs 1649.2±98.96µs -0.83%
Boolean Object Access (Execution) 4.8±0.16µs 5.0±0.22µs -4.00%
Boolean Object Access (Full) 277.9±10.80µs 284.4±17.45µs -2.29%
Clean js (Execution) 732.2±25.98µs 779.1±24.79µs -6.02%
Clean js (Full) 1073.8±48.66µs 1088.3±44.48µs -1.33%
Clean js (Parser) 40.1±1.41µs 37.7±1.55µs +6.37%
Create Realm 465.3±23.26ns 482.0±21.68ns -3.46%
Dynamic Object Property Access (Execution) 5.7±0.27µs 5.8±0.19µs -1.72%
Dynamic Object Property Access (Full) 285.7±9.42µs 283.3±17.00µs +0.85%
Expression (Parser) 7.0±0.25µs 6.9±0.25µs +1.45%
Fibonacci (Execution) 916.8±30.16µs 921.9±25.85µs -0.55%
Fibonacci (Full) 1203.0±50.05µs 1199.9±50.00µs +0.26%
For loop (Execution) 23.3±1.04µs 23.1±0.82µs +0.87%
For loop (Full) 302.1±13.02µs 300.8±10.47µs +0.43%
For loop (Parser) 19.1±2.45µs 18.3±0.81µs +4.37%
Goal Symbols (Parser) 12.4±0.56µs 12.4±0.50µs 0.00%
Hello World (Parser) 3.2±0.12µs 3.1±0.09µs +3.23%
Long file (Parser) 822.2±43.83ns 831.9±61.28ns -1.17%
Mini js (Execution) 664.3±26.39µs 690.9±23.17µs -3.85%
Mini js (Full) 1006.4±38.78µs 979.0±41.49µs +2.80%
Mini js (Parser) 35.1±1.19µs 33.8±1.54µs +3.85%
Number Object Access (Execution) 3.9±0.21µs 4.0±0.15µs -2.50%
Number Object Access (Full) 274.3±10.17µs 277.7±15.13µs -1.22%
Object Creation (Execution) 4.9±0.33µs 5.0±0.20µs -2.00%
Object Creation (Full) 278.5±9.74µs 278.7±12.39µs -0.07%
RegExp (Execution) 69.6±3.23µs 69.9±2.66µs -0.43%
RegExp (Full) 359.5±15.14µs 369.9±12.19µs -2.81%
RegExp Literal (Execution) 73.9±3.03µs 74.1±3.84µs -0.27%
RegExp Literal (Full) 360.3±20.43µs 364.5±12.20µs -1.15%
RegExp Literal Creation (Execution) 68.5±3.01µs 72.7±6.17µs -5.78%
RegExp Literal Creation (Full) 350.4±14.20µs 356.8±23.43µs -1.79%
Static Object Property Access (Execution) 5.0±0.18µs 5.2±0.22µs -3.85%
Static Object Property Access (Full) 284.7±11.43µs 285.8±14.90µs -0.38%
String Object Access (Execution) 7.3±0.31µs 7.5±0.60µs -2.67%
String Object Access (Full) 276.3±12.21µs 286.0±10.17µs -3.39%
String comparison (Execution) 6.4±0.29µs 6.8±0.27µs -5.88%
String comparison (Full) 281.6±11.64µs 283.4±9.43µs -0.64%
String concatenation (Execution) 5.5±0.23µs 5.4±0.24µs +1.85%
String concatenation (Full) 273.2±12.45µs 278.1±11.75µs -1.76%
String copy (Execution) 4.1±0.19µs 4.2±0.16µs -2.38%
String copy (Full) 271.1±12.32µs 273.5±11.08µs -0.88%
Symbols (Execution) 3.4±0.13µs 3.4±0.13µs 0.00%
Symbols (Full) 246.8±9.41µs 248.5±9.56µs -0.68%

@github-actions
Copy link

Benchmark for 6b1a49f

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 379.2±43.87ns 363.5±35.76ns +4.32%
Arithmetic operations (Full) 257.6±32.25µs 266.6±25.24µs -3.38%
Array access (Execution) 8.0±0.67µs 8.4±0.72µs -4.76%
Array access (Full) 292.2±28.08µs 270.2±23.27µs +8.14%
Array creation (Execution) 3.1±0.25ms 3.3±0.29ms -6.06%
Array creation (Full) 3.5±0.26ms 3.4±0.28ms +2.94%
Array pop (Execution) 1127.2±118.11µs 1193.2±111.66µs -5.53%
Array pop (Full) 1592.8±130.53µs 1686.1±181.16µs -5.53%
Boolean Object Access (Execution) 4.7±0.44µs 4.9±0.53µs -4.08%
Boolean Object Access (Full) 278.0±116.89µs 259.2±19.75µs +7.25%
Clean js (Execution) 777.1±73.42µs 781.2±88.41µs -0.52%
Clean js (Full) 1005.6±66.49µs 1062.9±95.53µs -5.39%
Clean js (Parser) 37.9±4.19µs 37.3±3.45µs +1.61%
Create Realm 463.0±49.34ns 476.6±39.40ns -2.85%
Dynamic Object Property Access (Execution) 5.7±0.64µs 5.8±0.70µs -1.72%
Dynamic Object Property Access (Full) 270.3±30.16µs 277.1±26.67µs -2.45%
Expression (Parser) 7.0±0.92µs 6.8±0.54µs +2.94%
Fibonacci (Execution) 854.9±85.82µs 911.5±87.60µs -6.21%
Fibonacci (Full) 1213.4±146.54µs 1136.3±111.86µs +6.79%
For loop (Execution) 22.7±1.91µs 24.3±2.15µs -6.58%
For loop (Full) 295.8±23.27µs 286.2±24.63µs +3.35%
For loop (Parser) 18.0±2.03µs 17.6±1.53µs +2.27%
Goal Symbols (Parser) 12.2±1.34µs 12.0±1.21µs +1.67%
Hello World (Parser) 3.1±0.29µs 3.2±0.32µs -3.13%
Long file (Parser) 765.6±73.24ns 767.7±51.25ns -0.27%
Mini js (Execution) 673.1±68.33µs 651.7±57.78µs +3.28%
Mini js (Full) 966.4±110.92µs 973.6±87.71µs -0.74%
Mini js (Parser) 34.9±3.86µs 33.6±3.29µs +3.87%
Number Object Access (Execution) 3.9±0.44µs 3.8±0.40µs +2.63%
Number Object Access (Full) 256.6±19.01µs 263.3±26.87µs -2.54%
Object Creation (Execution) 5.2±0.53µs 4.8±0.50µs +8.33%
Object Creation (Full) 270.5±29.70µs 277.1±29.39µs -2.38%
RegExp (Execution) 66.7±6.96µs 69.5±8.29µs -4.03%
RegExp (Full) 351.8±44.58µs 361.4±39.42µs -2.66%
RegExp Literal (Execution) 69.1±5.73µs 75.8±7.32µs -8.84%
RegExp Literal (Full) 335.1±25.74µs 334.0±31.19µs +0.33%
RegExp Literal Creation (Execution) 69.4±8.78µs 69.3±7.83µs +0.14%
RegExp Literal Creation (Full) 328.2±30.71µs 337.0±35.50µs -2.61%
Static Object Property Access (Execution) 4.9±0.44µs 5.1±0.52µs -3.92%
Static Object Property Access (Full) 257.7±20.80µs 276.8±32.43µs -6.90%
String Object Access (Execution) 6.9±0.64µs 7.4±0.80µs -6.76%
String Object Access (Full) 273.3±22.64µs 272.8±22.06µs +0.18%
String comparison (Execution) 6.8±1.04µs 6.7±0.80µs +1.49%
String comparison (Full) 282.5±31.10µs 267.0±30.86µs +5.81%
String concatenation (Execution) 5.1±0.41µs 5.6±0.59µs -8.93%
String concatenation (Full) 264.4±28.29µs 271.1±30.20µs -2.47%
String copy (Execution) 3.9±0.33µs 4.0±0.42µs -2.50%
String copy (Full) 268.2±31.12µs 253.3±26.04µs +5.88%
Symbols (Execution) 3.3±0.36µs 3.4±0.30µs -2.94%
Symbols (Full) 255.0±27.04µs 255.1±34.06µs -0.04%

@github-actions
Copy link

Benchmark for dd4fe8c

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 361.5±15.16ns 366.4±23.92ns -1.34%
Arithmetic operations (Full) 243.9±19.44µs 238.5±12.05µs +2.26%
Array access (Execution) 8.5±0.53µs 8.2±0.61µs +3.66%
Array access (Full) 265.0±13.24µs 287.6±11.45µs -7.86%
Array creation (Execution) 3.3±0.13ms 3.2±0.16ms +3.13%
Array creation (Full) 3.3±0.14ms 3.5±0.15ms -5.71%
Array pop (Execution) 1130.3±77.25µs 1177.7±120.70µs -4.02%
Array pop (Full) 1513.2±82.09µs 1666.3±89.39µs -9.19%
Boolean Object Access (Execution) 4.4±0.32µs 4.6±0.30µs -4.35%
Boolean Object Access (Full) 258.7±15.44µs 251.1±16.83µs +3.03%
Clean js (Execution) 710.8±41.90µs 772.1±52.96µs -7.94%
Clean js (Full) 973.6±57.37µs 968.5±33.13µs +0.53%
Clean js (Parser) 35.7±3.27µs 36.1±2.09µs -1.11%
Create Realm 480.8±13.91ns 447.7±21.90ns +7.39%
Dynamic Object Property Access (Execution) 5.4±0.56µs 5.9±0.42µs -8.47%
Dynamic Object Property Access (Full) 267.5±26.29µs 272.2±12.90µs -1.73%
Expression (Parser) 6.8±0.70µs 6.3±0.46µs +7.94%
Fibonacci (Execution) 875.1±39.03µs 913.4±25.75µs -4.19%
Fibonacci (Full) 1143.6±54.42µs 1319.8±543.58µs -13.35%
For loop (Execution) 23.3±0.92µs 23.9±1.75µs -2.51%
For loop (Full) 294.9±18.07µs 305.0±32.45µs -3.31%
For loop (Parser) 17.1±1.09µs 17.9±1.05µs -4.47%
Goal Symbols (Parser) 11.6±0.63µs 11.8±0.56µs -1.69%
Hello World (Parser) 3.2±1.07µs 2.9±0.17µs +10.34%
Long file (Parser) 774.3±41.06ns 774.4±84.15ns -0.01%
Mini js (Execution) 667.6±45.44µs 675.3±41.42µs -1.14%
Mini js (Full) 908.8±88.23µs 901.7±38.96µs +0.79%
Mini js (Parser) 32.6±2.23µs 31.1±1.51µs +4.82%
Number Object Access (Execution) 3.6±0.21µs 3.6±0.20µs 0.00%
Number Object Access (Full) 255.2±17.12µs 245.8±14.80µs +3.82%
Object Creation (Execution) 4.7±0.21µs 4.9±0.28µs -4.08%
Object Creation (Full) 251.5±14.77µs 269.5±13.01µs -6.68%
RegExp (Execution) 65.8±4.12µs 71.0±5.02µs -7.32%
RegExp (Full) 335.1±24.15µs 367.4±20.72µs -8.79%
RegExp Literal (Execution) 70.0±5.68µs 73.7±3.33µs -5.02%
RegExp Literal (Full) 324.3±19.10µs 346.9±21.37µs -6.51%
RegExp Literal Creation (Execution) 66.2±3.45µs 71.6±4.95µs -7.54%
RegExp Literal Creation (Full) 329.4±26.38µs 347.4±14.38µs -5.18%
Static Object Property Access (Execution) 4.8±0.21µs 5.0±0.22µs -4.00%
Static Object Property Access (Full) 261.2±15.54µs 278.9±9.09µs -6.35%
String Object Access (Execution) 6.6±0.46µs 7.3±0.38µs -9.59%
String Object Access (Full) 256.1±13.47µs 254.3±22.35µs +0.71%
String comparison (Execution) 6.1±0.35µs 6.9±0.44µs -11.59%
String comparison (Full) 254.3±15.33µs 274.2±22.19µs -7.26%
String concatenation (Execution) 5.1±0.37µs 5.5±0.28µs -7.27%
String concatenation (Full) 255.1±34.61µs 261.1±16.61µs -2.30%
String copy (Execution) 3.9±0.27µs 4.1±0.18µs -4.88%
String copy (Full) 242.7±11.73µs 241.8±11.97µs +0.37%
Symbols (Execution) 3.4±0.15µs 3.3±0.20µs +3.03%
Symbols (Full) 243.0±14.35µs 244.7±14.62µs -0.69%

@github-actions
Copy link

Benchmark for 3e15427

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 375.4±6.53ns 373.6±3.98ns +0.48%
Arithmetic operations (Full) 250.5±3.05µs 254.0±6.54µs -1.38%
Array access (Execution) 8.3±0.29µs 8.1±0.11µs +2.47%
Array access (Full) 275.1±5.76µs 276.6±11.83µs -0.54%
Array creation (Execution) 3.4±0.03ms 3.3±0.08ms +3.03%
Array creation (Full) 3.5±0.05ms 3.7±0.07ms -5.41%
Array pop (Execution) 1231.4±27.98µs 1144.6±66.59µs +7.58%
Array pop (Full) 1598.4±22.98µs 1702.0±53.05µs -6.09%
Boolean Object Access (Execution) 4.9±0.06µs 4.9±0.11µs 0.00%
Boolean Object Access (Full) 263.3±6.32µs 268.9±8.09µs -2.08%
Clean js (Execution) 750.5±10.89µs 732.3±17.79µs +2.49%
Clean js (Full) 1036.1±29.27µs 1062.8±34.88µs -2.51%
Clean js (Parser) 35.8±0.95µs 36.1±1.09µs -0.83%
Create Realm 474.0±7.24ns 474.2±10.25ns -0.04%
Dynamic Object Property Access (Execution) 5.4±0.13µs 5.3±0.11µs +1.89%
Dynamic Object Property Access (Full) 264.5±7.59µs 264.7±6.15µs -0.08%
Expression (Parser) 6.8±0.16µs 6.9±0.28µs -1.45%
Fibonacci (Execution) 823.8±30.55µs 813.2±12.03µs +1.30%
Fibonacci (Full) 1094.5±23.44µs 1110.1±24.59µs -1.41%
For loop (Execution) 22.4±0.41µs 22.7±0.37µs -1.32%
For loop (Full) 289.2±8.21µs 290.5±10.72µs -0.45%
For loop (Parser) 17.7±0.34µs 17.6±1.13µs +0.57%
Goal Symbols (Parser) 12.0±0.38µs 11.9±0.25µs +0.84%
Hello World (Parser) 3.1±0.11µs 3.0±0.05µs +3.33%
Long file (Parser) 769.8±15.18ns 772.8±24.95ns -0.39%
Mini js (Execution) 684.6±13.68µs 664.2±15.98µs +3.07%
Mini js (Full) 960.4±36.33µs 980.4±27.70µs -2.04%
Mini js (Parser) 31.3±0.31µs 31.4±0.23µs -0.32%
Number Object Access (Execution) 3.9±0.11µs 3.9±0.11µs 0.00%
Number Object Access (Full) 261.9±6.25µs 261.8±6.07µs +0.04%
Object Creation (Execution) 4.6±0.07µs 4.6±0.32µs 0.00%
Object Creation (Full) 263.4±4.53µs 269.3±4.93µs -2.19%
RegExp (Execution) 67.4±1.80µs 65.5±1.34µs +2.90%
RegExp (Full) 344.7±8.66µs 347.0±5.76µs -0.66%
RegExp Literal (Execution) 69.8±1.83µs 70.2±7.59µs -0.57%
RegExp Literal (Full) 347.4±62.89µs 347.5±6.48µs -0.03%
RegExp Literal Creation (Execution) 66.4±1.84µs 65.6±1.40µs +1.22%
RegExp Literal Creation (Full) 330.3±5.74µs 336.6±12.92µs -1.87%
Static Object Property Access (Execution) 4.9±0.18µs 4.8±0.21µs +2.08%
Static Object Property Access (Full) 261.0±3.36µs 265.4±5.85µs -1.66%
String Object Access (Execution) 7.3±0.27µs 7.0±0.16µs +4.29%
String Object Access (Full) 270.3±9.95µs 268.2±5.77µs +0.78%
String comparison (Execution) 6.4±0.09µs 6.4±0.14µs 0.00%
String comparison (Full) 266.7±7.68µs 270.9±22.35µs -1.55%
String concatenation (Execution) 5.2±0.17µs 5.2±0.10µs 0.00%
String concatenation (Full) 263.8±5.43µs 262.1±7.47µs +0.65%
String copy (Execution) 3.9±0.07µs 3.8±0.06µs +2.63%
String copy (Full) 255.2±4.63µs 259.9±7.65µs -1.81%
Symbols (Execution) 3.2±0.05µs 3.2±0.06µs 0.00%
Symbols (Full) 241.1±7.70µs 242.7±7.44µs -0.66%

@github-actions
Copy link

Benchmark for 1bf525a

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 320.7±18.85ns 319.0±13.80ns +0.53%
Arithmetic operations (Full) 214.5±9.98µs 220.3±12.53µs -2.63%
Array access (Execution) 7.0±0.24µs 6.9±0.25µs +1.45%
Array access (Full) 231.7±8.70µs 232.0±7.05µs -0.13%
Array creation (Execution) 2.9±0.14ms 2.8±0.13ms +3.57%
Array creation (Full) 3.0±0.07ms 3.2±0.12ms -6.25%
Array pop (Execution) 1041.5±43.60µs 963.6±28.95µs +8.08%
Array pop (Full) 1363.0±64.09µs 1433.7±46.03µs -4.93%
Boolean Object Access (Execution) 4.1±0.13µs 4.2±0.18µs -2.38%
Boolean Object Access (Full) 231.7±11.60µs 223.9±6.42µs +3.48%
Clean js (Execution) 632.5±20.68µs 626.6±36.65µs +0.94%
Clean js (Full) 885.4±34.80µs 900.9±46.46µs -1.72%
Clean js (Parser) 30.9±1.42µs 30.5±1.17µs +1.31%
Create Realm 411.2±20.45ns 402.4±21.92ns +2.19%
Dynamic Object Property Access (Execution) 4.5±0.17µs 4.6±0.22µs -2.17%
Dynamic Object Property Access (Full) 233.3±14.95µs 224.7±7.76µs +3.83%
Expression (Parser) 5.9±0.44µs 5.7±0.24µs +3.51%
Fibonacci (Execution) 690.7±42.02µs 701.5±32.97µs -1.54%
Fibonacci (Full) 935.3±39.48µs 939.0±30.85µs -0.39%
For loop (Execution) 19.0±0.76µs 19.5±0.75µs -2.56%
For loop (Full) 246.9±9.22µs 247.8±12.89µs -0.36%
For loop (Parser) 15.1±0.69µs 14.8±0.61µs +2.03%
Goal Symbols (Parser) 10.1±0.35µs 10.1±0.41µs 0.00%
Hello World (Parser) 2.6±0.09µs 2.5±0.12µs +4.00%
Long file (Parser) 656.3±18.30ns 652.1±23.59ns +0.64%
Mini js (Execution) 576.3±18.18µs 562.8±22.08µs +2.40%
Mini js (Full) 802.9±22.87µs 821.1±30.08µs -2.22%
Mini js (Parser) 26.8±1.40µs 27.2±1.19µs -1.47%
Number Object Access (Execution) 3.3±0.52µs 3.3±0.11µs 0.00%
Number Object Access (Full) 219.8±6.30µs 224.1±9.70µs -1.92%
Object Creation (Execution) 4.1±0.18µs 3.9±0.12µs +5.13%
Object Creation (Full) 224.9±8.73µs 230.1±11.44µs -2.26%
RegExp (Execution) 56.5±3.83µs 56.2±2.85µs +0.53%
RegExp (Full) 291.2±12.09µs 295.0±15.92µs -1.29%
RegExp Literal (Execution) 58.8±2.24µs 58.5±2.16µs +0.51%
RegExp Literal (Full) 288.6±22.12µs 295.1±14.34µs -2.20%
RegExp Literal Creation (Execution) 56.2±2.28µs 57.1±5.01µs -1.58%
RegExp Literal Creation (Full) 285.0±12.37µs 286.4±15.68µs -0.49%
Static Object Property Access (Execution) 4.1±0.13µs 4.1±0.13µs 0.00%
Static Object Property Access (Full) 226.5±9.41µs 226.1±14.31µs +0.18%
String Object Access (Execution) 6.0±0.26µs 6.1±0.37µs -1.64%
String Object Access (Full) 226.6±9.83µs 231.3±11.11µs -2.03%
String comparison (Execution) 5.4±0.18µs 5.6±0.34µs -3.57%
String comparison (Full) 225.5±9.06µs 227.5±8.49µs -0.88%
String concatenation (Execution) 4.4±0.35µs 4.4±0.25µs 0.00%
String concatenation (Full) 222.6±10.16µs 221.7±8.25µs +0.41%
String copy (Execution) 3.3±0.12µs 3.3±0.14µs 0.00%
String copy (Full) 219.2±7.97µs 221.3±10.32µs -0.95%
Symbols (Execution) 2.7±0.11µs 2.7±0.12µs 0.00%
Symbols (Full) 204.4±8.98µs 207.2±10.73µs -1.35%

@HalidOdat HalidOdat added enhancement New feature or request execution Issues or PRs related to code execution labels Sep 24, 2020
@HalidOdat HalidOdat requested a review from Razican September 24, 2020 19:04
@github-actions
Copy link

Benchmark for 9a6d698

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 330.4±16.09ns 349.7±27.53ns -5.52%
Arithmetic operations (Full) 237.5±13.26µs 259.4±14.56µs -8.44%
Array access (Execution) 7.8±0.31µs 7.8±0.42µs 0.00%
Array access (Full) 280.5±45.49µs 274.3±19.47µs +2.26%
Array creation (Execution) 3.0±0.11ms 2.9±0.13ms +3.45%
Array creation (Full) 3.2±0.11ms 3.2±0.16ms 0.00%
Array pop (Execution) 1072.6±82.75µs 1018.5±46.22µs +5.31%
Array pop (Full) 1509.6±69.14µs 1453.5±116.18µs +3.86%
Boolean Object Access (Execution) 4.7±0.20µs 4.5±0.27µs +4.44%
Boolean Object Access (Full) 247.7±11.67µs 262.5±35.85µs -5.64%
Clean js (Execution) 691.8±27.78µs 684.3±31.17µs +1.10%
Clean js (Full) 974.2±54.69µs 983.4±57.71µs -0.94%
Clean js (Parser) 36.9±2.24µs 34.4±1.48µs +7.27%
Create Realm 439.9±24.57ns 427.2±23.80ns +2.97%
Dynamic Object Property Access (Execution) 5.2±0.23µs 5.1±0.28µs +1.96%
Dynamic Object Property Access (Full) 255.0±14.96µs 256.2±14.28µs -0.47%
Expression (Parser) 6.2±0.49µs 6.3±0.29µs -1.59%
Fibonacci (Execution) 855.2±39.78µs 828.4±33.89µs +3.24%
Fibonacci (Full) 1100.6±76.82µs 1086.2±50.06µs +1.33%
For loop (Execution) 21.8±1.33µs 22.1±1.68µs -1.36%
For loop (Full) 275.4±14.76µs 279.7±14.14µs -1.54%
For loop (Parser) 17.2±0.93µs 18.1±1.11µs -4.97%
Goal Symbols (Parser) 11.5±0.91µs 11.1±0.59µs +3.60%
Hello World (Parser) 3.0±0.16µs 3.0±0.19µs 0.00%
Long file (Parser) 742.6±37.73ns 743.4±43.98ns -0.11%
Mini js (Execution) 616.3±32.06µs 623.1±39.05µs -1.09%
Mini js (Full) 871.0±36.28µs 913.3±58.47µs -4.63%
Mini js (Parser) 30.6±1.64µs 30.5±1.75µs +0.33%
Number Object Access (Execution) 3.6±0.19µs 3.5±0.17µs +2.86%
Number Object Access (Full) 256.0±14.39µs 254.5±15.65µs +0.59%
Object Creation (Execution) 4.3±0.20µs 4.3±0.19µs 0.00%
Object Creation (Full) 256.0±15.35µs 254.3±14.83µs +0.67%
RegExp (Execution) 65.1±3.73µs 63.9±4.32µs +1.88%
RegExp (Full) 319.5±12.19µs 338.1±18.93µs -5.50%
RegExp Literal (Execution) 67.9±6.16µs 67.2±3.24µs +1.04%
RegExp Literal (Full) 331.6±21.69µs 323.4±14.99µs +2.54%
RegExp Literal Creation (Execution) 67.2±4.22µs 63.4±3.24µs +5.99%
RegExp Literal Creation (Full) 331.7±20.94µs 318.9±14.01µs +4.01%
Static Object Property Access (Execution) 4.7±0.20µs 4.6±0.25µs +2.17%
Static Object Property Access (Full) 253.1±15.79µs 261.4±18.52µs -3.18%
String Object Access (Execution) 6.6±0.35µs 6.7±0.42µs -1.49%
String Object Access (Full) 252.4±16.73µs 264.9±22.66µs -4.72%
String comparison (Execution) 6.0±0.31µs 6.0±0.35µs 0.00%
String comparison (Full) 253.6±13.54µs 256.6±14.66µs -1.17%
String concatenation (Execution) 4.9±0.23µs 4.9±0.25µs 0.00%
String concatenation (Full) 257.5±23.66µs 249.5±11.24µs +3.21%
String copy (Execution) 3.7±0.25µs 3.7±0.17µs 0.00%
String copy (Full) 251.9±13.79µs 245.7±11.89µs +2.52%
Symbols (Execution) 3.1±0.17µs 3.1±0.23µs 0.00%
Symbols (Full) 233.6±13.89µs 228.4±12.16µs +2.28%

@github-actions
Copy link

Benchmark for 731adac

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 365.6±5.39ns 365.2±4.18ns +0.11%
Arithmetic operations (Full) 241.3±3.03µs 253.7±13.18µs -4.89%
Array access (Execution) 7.8±0.11µs 7.8±0.13µs 0.00%
Array access (Full) 264.7±3.89µs 264.3±3.71µs +0.15%
Array creation (Execution) 3.1±0.03ms 3.1±0.07ms 0.00%
Array creation (Full) 3.6±0.05ms 3.6±0.03ms 0.00%
Array pop (Execution) 1134.9±35.65µs 1088.0±15.69µs +4.31%
Array pop (Full) 1646.3±60.65µs 1642.5±16.16µs +0.23%
Boolean Object Access (Execution) 4.7±0.09µs 4.6±0.07µs +2.17%
Boolean Object Access (Full) 255.4±3.48µs 254.6±3.55µs +0.31%
Clean js (Execution) 706.0±9.21µs 704.5±10.48µs +0.21%
Clean js (Full) 1014.3±19.24µs 1022.8±34.99µs -0.83%
Clean js (Parser) 34.5±0.46µs 34.2±0.43µs +0.88%
Create Realm 457.3±8.23ns 484.8±16.47ns -5.67%
Dynamic Object Property Access (Execution) 5.1±0.08µs 5.2±0.09µs -1.92%
Dynamic Object Property Access (Full) 256.7±4.24µs 257.7±4.37µs -0.39%
Expression (Parser) 6.5±0.11µs 6.7±0.10µs -2.99%
Fibonacci (Execution) 778.7±10.59µs 762.7±9.64µs +2.10%
Fibonacci (Full) 1060.3±20.52µs 1074.8±15.68µs -1.35%
For loop (Execution) 21.8±0.42µs 21.3±0.36µs +2.35%
For loop (Full) 277.7±3.31µs 281.6±4.22µs -1.38%
For loop (Parser) 16.9±0.30µs 16.8±0.25µs +0.60%
Goal Symbols (Parser) 11.5±0.14µs 11.4±0.14µs +0.88%
Hello World (Parser) 2.9±0.04µs 2.9±0.05µs 0.00%
Long file (Parser) 744.1±8.72ns 730.6±11.02ns +1.85%
Mini js (Execution) 647.6±15.40µs 640.1±10.68µs +1.17%
Mini js (Full) 939.0±10.42µs 934.6±13.05µs +0.47%
Mini js (Parser) 30.5±0.36µs 30.5±0.48µs 0.00%
Number Object Access (Execution) 3.7±0.06µs 3.7±0.05µs 0.00%
Number Object Access (Full) 252.8±3.31µs 252.5±4.13µs +0.12%
Object Creation (Execution) 4.3±0.08µs 4.4±0.06µs -2.27%
Object Creation (Full) 249.2±3.22µs 260.6±2.60µs -4.37%
RegExp (Execution) 63.5±1.27µs 64.0±2.52µs -0.78%
RegExp (Full) 330.6±4.35µs 335.4±4.99µs -1.43%
RegExp Literal (Execution) 67.1±1.43µs 65.6±1.30µs +2.29%
RegExp Literal (Full) 330.8±4.62µs 334.0±4.84µs -0.96%
RegExp Literal Creation (Execution) 63.1±1.38µs 62.4±1.28µs +1.12%
RegExp Literal Creation (Full) 321.3±4.35µs 324.5±3.49µs -0.99%
Static Object Property Access (Execution) 4.6±0.07µs 4.7±0.08µs -2.13%
Static Object Property Access (Full) 247.9±2.80µs 253.9±3.52µs -2.36%
String Object Access (Execution) 6.8±0.11µs 6.8±0.08µs 0.00%
String Object Access (Full) 258.8±3.49µs 259.7±4.16µs -0.35%
String comparison (Execution) 6.1±0.07µs 6.0±0.09µs +1.67%
String comparison (Full) 259.0±3.44µs 258.3±4.29µs +0.27%
String concatenation (Execution) 4.9±0.08µs 4.9±0.07µs 0.00%
String concatenation (Full) 251.6±4.12µs 251.2±2.94µs +0.16%
String copy (Execution) 3.7±0.05µs 3.7±0.06µs 0.00%
String copy (Full) 248.8±3.37µs 249.9±3.95µs -0.44%
Symbols (Execution) 3.0±0.04µs 3.1±0.05µs -3.23%
Symbols (Full) 233.3±3.10µs 232.0±2.94µs +0.56%

tester/src/exec.rs Outdated Show resolved Hide resolved
Co-authored-by: Halid Odat <halidodat@gmail.com>
@github-actions
Copy link

Benchmark for cf1da03

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 350.9±4.40ns 353.7±4.66ns -0.79%
Arithmetic operations (Full) 238.6±2.62µs 235.4±2.92µs +1.36%
Array access (Execution) 7.8±0.13µs 7.8±0.11µs 0.00%
Array access (Full) 259.8±3.29µs 261.2±4.03µs -0.54%
Array creation (Execution) 3.2±0.03ms 3.3±0.03ms -3.03%
Array creation (Full) 3.3±0.03ms 3.3±0.03ms 0.00%
Array pop (Execution) 1157.9±14.94µs 1194.9±16.44µs -3.10%
Array pop (Full) 1529.5±20.61µs 1506.4±17.20µs +1.53%
Boolean Object Access (Execution) 4.5±0.07µs 4.5±0.06µs 0.00%
Boolean Object Access (Full) 254.2±4.33µs 247.7±3.04µs +2.62%
Clean js (Execution) 699.0±9.16µs 720.2±12.30µs -2.94%
Clean js (Full) 987.3±13.33µs 978.1±14.49µs +0.94%
Clean js (Parser) 33.7±0.41µs 33.7±0.54µs 0.00%
Create Realm 448.3±8.49ns 465.3±7.62ns -3.65%
Dynamic Object Property Access (Execution) 5.0±0.07µs 5.1±0.07µs -1.96%
Dynamic Object Property Access (Full) 256.4±3.75µs 249.2±2.71µs +2.89%
Expression (Parser) 6.4±0.10µs 6.4±0.08µs 0.00%
Fibonacci (Execution) 762.7±11.58µs 761.1±15.28µs +0.21%
Fibonacci (Full) 1037.7±15.52µs 1033.9±14.04µs +0.37%
For loop (Execution) 21.3±0.31µs 21.1±0.31µs +0.95%
For loop (Full) 275.5±3.49µs 271.0±3.99µs +1.66%
For loop (Parser) 16.6±0.27µs 16.4±0.20µs +1.22%
Goal Symbols (Parser) 11.2±0.12µs 11.2±0.14µs 0.00%
Hello World (Parser) 2.8±0.03µs 2.8±0.03µs 0.00%
Long file (Parser) 730.7±10.57ns 726.9±8.22ns +0.52%
Mini js (Execution) 644.0±10.70µs 660.8±9.45µs -2.54%
Mini js (Full) 901.3±12.21µs 897.0±15.23µs +0.48%
Mini js (Parser) 29.8±0.31µs 29.7±0.37µs +0.34%
Number Object Access (Execution) 3.6±0.05µs 3.6±0.05µs 0.00%
Number Object Access (Full) 247.6±4.21µs 243.4±4.41µs +1.73%
Object Creation (Execution) 4.2±0.07µs 4.2±0.06µs 0.00%
Object Creation (Full) 249.7±3.09µs 248.7±3.88µs +0.40%
RegExp (Execution) 61.8±1.56µs 63.8±1.35µs -3.13%
RegExp (Full) 322.2±3.77µs 321.9±5.51µs +0.09%
RegExp Literal (Execution) 64.9±1.43µs 66.1±1.72µs -1.82%
RegExp Literal (Full) 322.6±4.37µs 321.1±5.28µs +0.47%
RegExp Literal Creation (Execution) 62.2±1.17µs 62.9±0.95µs -1.11%
RegExp Literal Creation (Full) 312.4±3.17µs 313.5±4.38µs -0.35%
Static Object Property Access (Execution) 4.6±0.10µs 4.6±0.09µs 0.00%
Static Object Property Access (Full) 249.8±3.82µs 247.7±3.25µs +0.85%
String Object Access (Execution) 6.6±0.07µs 6.8±0.11µs -2.94%
String Object Access (Full) 256.5±3.89µs 251.2±3.41µs +2.11%
String comparison (Execution) 6.0±0.08µs 5.9±0.08µs +1.69%
String comparison (Full) 251.9±2.87µs 255.3±4.66µs -1.33%
String concatenation (Execution) 4.8±0.06µs 4.8±0.07µs 0.00%
String concatenation (Full) 247.2±3.08µs 244.3±3.33µs +1.19%
String copy (Execution) 3.6±0.05µs 3.7±0.07µs -2.70%
String copy (Full) 243.6±2.87µs 237.9±2.53µs +2.40%
Symbols (Execution) 3.0±0.04µs 3.1±0.04µs -3.23%
Symbols (Full) 229.2±2.75µs 228.9±3.85µs +0.13%

@github-actions
Copy link

Benchmark for cf1da03

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 357.5±18.98ns 370.0±25.54ns -3.38%
Arithmetic operations (Full) 255.5±10.90µs 245.8±10.61µs +3.95%
Array access (Execution) 8.5±0.36µs 8.1±0.50µs +4.94%
Array access (Full) 268.2±18.55µs 267.2±13.33µs +0.37%
Array creation (Execution) 3.4±0.10ms 2.9±0.11ms +17.24%
Array creation (Full) 3.7±0.14ms 3.4±0.18ms +8.82%
Array pop (Execution) 1186.5±38.95µs 1010.3±51.42µs +17.44%
Array pop (Full) 1702.9±129.97µs 1567.2±114.25µs +8.66%
Boolean Object Access (Execution) 4.8±0.19µs 4.7±0.29µs +2.13%
Boolean Object Access (Full) 274.5±9.17µs 275.4±10.26µs -0.33%
Clean js (Execution) 723.0±34.20µs 738.8±42.64µs -2.14%
Clean js (Full) 1062.7±113.88µs 997.7±44.69µs +6.51%
Clean js (Parser) 39.3±2.29µs 38.6±2.41µs +1.81%
Create Realm 471.8±33.12ns 488.7±54.14ns -3.46%
Dynamic Object Property Access (Execution) 5.8±0.49µs 5.3±0.28µs +9.43%
Dynamic Object Property Access (Full) 278.6±22.48µs 282.6±11.13µs -1.42%
Expression (Parser) 6.8±0.40µs 6.8±0.20µs 0.00%
Fibonacci (Execution) 899.9±34.56µs 907.3±37.56µs -0.82%
Fibonacci (Full) 1160.4±47.79µs 1097.2±69.17µs +5.76%
For loop (Execution) 25.2±2.77µs 21.9±1.33µs +15.07%
For loop (Full) 291.7±10.92µs 277.3±12.44µs +5.19%
For loop (Parser) 18.6±0.77µs 18.2±1.61µs +2.20%
Goal Symbols (Parser) 12.6±0.86µs 12.6±0.63µs 0.00%
Hello World (Parser) 3.2±0.16µs 3.2±0.12µs 0.00%
Long file (Parser) 812.0±33.45ns 812.9±79.92ns -0.11%
Mini js (Execution) 673.0±17.89µs 667.0±37.48µs +0.90%
Mini js (Full) 980.7±44.15µs 953.0±49.26µs +2.91%
Mini js (Parser) 34.5±1.06µs 33.6±1.58µs +2.68%
Number Object Access (Execution) 3.8±0.14µs 3.7±0.13µs +2.70%
Number Object Access (Full) 276.7±13.11µs 269.2±10.09µs +2.79%
Object Creation (Execution) 4.9±0.27µs 4.5±0.17µs +8.89%
Object Creation (Full) 274.3±12.41µs 286.1±17.51µs -4.12%
RegExp (Execution) 70.3±3.76µs 64.3±3.08µs +9.33%
RegExp (Full) 361.0±15.01µs 355.3±13.47µs +1.60%
RegExp Literal (Execution) 74.0±3.14µs 71.7±3.56µs +3.21%
RegExp Literal (Full) 353.2±18.25µs 351.2±16.77µs +0.57%
RegExp Literal Creation (Execution) 73.6±6.16µs 67.5±4.97µs +9.04%
RegExp Literal Creation (Full) 345.0±18.20µs 350.8±17.07µs -1.65%
Static Object Property Access (Execution) 5.2±0.27µs 4.9±0.27µs +6.12%
Static Object Property Access (Full) 270.2±11.62µs 282.8±17.13µs -4.46%
String Object Access (Execution) 7.3±0.49µs 7.0±0.31µs +4.29%
String Object Access (Full) 272.7±13.22µs 273.6±19.46µs -0.33%
String comparison (Execution) 6.8±0.55µs 6.7±0.27µs +1.49%
String comparison (Full) 284.0±38.75µs 289.9±18.35µs -2.04%
String concatenation (Execution) 5.6±0.30µs 5.6±0.75µs 0.00%
String concatenation (Full) 269.9±13.25µs 279.6±26.44µs -3.47%
String copy (Execution) 4.3±1.06µs 4.0±0.23µs +7.50%
String copy (Full) 268.2±25.92µs 272.0±10.21µs -1.40%
Symbols (Execution) 3.2±0.26µs 3.3±0.19µs -3.03%
Symbols (Full) 244.0±11.15µs 248.1±13.76µs -1.65%

@HalidOdat HalidOdat merged commit bb57270 into master Sep 28, 2020
@HalidOdat HalidOdat deleted the feature/548 branch September 28, 2020 21:09
@HalidOdat HalidOdat linked an issue Sep 28, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Label statements
4 participants