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

Moved value operations from Interpreter to Value #625

Merged
merged 19 commits into from
Aug 15, 2020

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Aug 11, 2020

This PR moves the value operation function from Interpreter to Value. There operations don't make sense to live in interpreter for example:

context.to_primitive(value, PreferredType::Number);

When you read this line its "context to primitive with value and preferred type number" this makes it seem like we are converting the context to a primitive, which is wrong! instead it should be:

value.to_primitive(context, PreferredType::Number);

When you read this line its "value to primitive with context and preferred type number" this makes sense and allows us to remove the #[allow(clippy::wrong_self_convention)]

Changes the following:

  • Moved Intepreter::to_primitive() => Value::to_primitive()
  • Moved exec::PreferredType to value::PreferredType
  • Added Value::display() which implements Display (this is done because it conflicts with Value::to_string(context))
  • Moved Interpreter::to_string() to Value::to_string()
  • Moved Interpreter::to_object() to Value::to_object()
  • Moved Interpreter::to_property_key() to Value::to_property_key()
  • Moved Interpreter::to_numeric() to Value::to_numeric()
  • Moved Interpreter::to_uint32() to Value::to_uint32()
  • Moved Interpreter::to_int32() to Value::to_int32()
  • Moved Interpreter::to_index() to Value::to_index()
  • Moved Interpreter::to_length() to Value::to_length()
  • Moved Interpreter::to_integer() to Value::to_integer()
  • Moved Interpreter::to_number() to Value::to_number()
  • Moved Interpreter::to_number() to Value::to_number()

@HalidOdat HalidOdat added enhancement New feature or request technical debt labels Aug 11, 2020
@HalidOdat HalidOdat added this to the v0.10.0 milestone Aug 11, 2020
@codecov
Copy link

codecov bot commented Aug 11, 2020

Codecov Report

Merging #625 into master will decrease coverage by 0.24%.
The diff coverage is 71.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #625      +/-   ##
==========================================
- Coverage   72.81%   72.56%   -0.25%     
==========================================
  Files         179      179              
  Lines       13197    13259      +62     
==========================================
+ Hits         9609     9621      +12     
- Misses       3588     3638      +50     
Impacted Files Coverage Δ
boa/src/builtins/error/mod.rs 32.00% <0.00%> (-4.37%) ⬇️
boa/src/builtins/error/syntax.rs 36.36% <0.00%> (ø)
boa/src/builtins/function/mod.rs 70.65% <0.00%> (ø)
boa/src/builtins/value/conversions.rs 49.27% <0.00%> (-4.06%) ⬇️
boa_cli/src/main.rs 33.33% <ø> (ø)
boa_wasm/src/lib.rs 0.00% <0.00%> (ø)
boa/src/builtins/string/mod.rs 45.81% <28.12%> (-3.39%) ⬇️
boa/src/builtins/console/mod.rs 29.37% <42.10%> (-0.45%) ⬇️
boa/src/builtins/value/operations.rs 44.40% <48.38%> (-0.20%) ⬇️
boa/src/builtins/regexp/mod.rs 71.42% <60.00%> (-1.48%) ⬇️
... and 29 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 607a534...9c5b69d. Read the comment docs.

@github-actions
Copy link

Benchmark for 76153ff

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 406.8±8.07ns 407.4±23.57ns -0.15%
Arithmetic operations (Full) 257.0±6.94µs 257.2±9.27µs -0.08%
Array access (Execution) 8.9±0.37µs 9.0±0.74µs -1.11%
Array access (Full) 277.3±11.97µs 275.8±8.55µs +0.54%
Array creation (Execution) 3.5±0.06ms 3.6±0.11ms -2.78%
Array creation (Full) 3.9±0.08ms 3.9±0.06ms 0.00%
Array pop (Execution) 1254.4±28.16µs 1267.5±65.60µs -1.03%
Array pop (Full) 1648.5±41.38µs 1656.6±34.35µs -0.49%
Boolean Object Access (Execution) 4.5±0.12µs 4.5±0.12µs 0.00%
Boolean Object Access (Full) 270.2±8.28µs 269.9±6.05µs +0.11%
Create Realm 500.6±27.69ns 489.1±15.16ns +2.35%
Dynamic Object Property Access (Execution) 5.4±0.18µs 5.2±0.10µs +3.85%
Dynamic Object Property Access (Full) 269.7±10.40µs 273.4±7.96µs -1.35%
Expression (Lexer) 2.5±0.12µs 2.5±0.07µs 0.00%
Expression (Parser) 5.6±0.15µs 5.8±0.11µs -3.45%
Fibonacci (Execution) 927.1±18.42µs 945.5±30.37µs -1.95%
Fibonacci (Full) 1243.4±32.54µs 1246.7±37.97µs -0.26%
For loop (Execution) 23.8±0.63µs 23.6±0.79µs +0.85%
For loop (Full) 292.4±8.71µs 294.2±6.01µs -0.61%
For loop (Lexer) 5.5±0.17µs 5.5±0.09µs 0.00%
For loop (Parser) 15.1±0.54µs 15.1±0.49µs 0.00%
Goal Symbols (Parser) 8.9±0.19µs 8.9±0.29µs 0.00%
Hello World (Lexer) 874.0±24.08ns 864.3±21.01ns +1.12%
Hello World (Parser) 2.3±0.15µs 2.3±0.06µs 0.00%
Long file (Parser) 6.8±0.13ms 6.7±0.10ms +1.49%
Number Object Access (Execution) 3.7±0.26µs 3.6±0.07µs +2.78%
Number Object Access (Full) 265.4±9.36µs 263.0±7.29µs +0.91%
Object Creation (Execution) 4.6±0.10µs 4.5±0.10µs +2.22%
Object Creation (Full) 324.7±9.00µs 322.2±7.97µs +0.78%
RegExp (Execution) 69.4±2.43µs 69.2±2.61µs +0.29%
RegExp (Full) 437.6±14.48µs 430.1±11.53µs +1.74%
RegExp Literal (Execution) 73.1±2.44µs 71.6±2.70µs +2.09%
RegExp Literal (Full) 354.9±13.72µs 358.1±15.15µs -0.89%
RegExp Literal Creation (Execution) 70.0±4.48µs 68.8±2.07µs +1.74%
RegExp Literal Creation (Full) 427.0±7.13µs 427.8±14.57µs -0.19%
Static Object Property Access (Execution) 4.7±0.14µs 4.7±0.13µs 0.00%
Static Object Property Access (Full) 269.9±9.13µs 272.4±7.66µs -0.92%
String Object Access (Execution) 7.0±0.38µs 6.9±0.20µs +1.45%
String Object Access (Full) 271.7±6.97µs 271.9±19.62µs -0.07%
String comparison (Execution) 6.4±0.32µs 6.5±0.38µs -1.54%
String comparison (Full) 274.7±14.06µs 268.9±7.02µs +2.16%
String concatenation (Execution) 5.2±0.22µs 5.1±0.24µs +1.96%
String concatenation (Full) 267.2±7.56µs 265.7±9.93µs +0.56%
String copy (Execution) 3.9±0.35µs 3.7±0.16µs +5.41%
String copy (Full) 262.9±11.35µs 263.6±9.51µs -0.27%
Symbols (Execution) 3.0±0.07µs 3.0±0.07µs 0.00%
Symbols (Full) 248.1±7.13µs 244.4±5.14µs +1.51%

@github-actions
Copy link

Benchmark for 8c7e9fa

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 340.6±17.92ns 309.2±20.39ns +10.16%
Arithmetic operations (Full) 220.6±10.24µs 228.7±28.94µs -3.54%
Array access (Execution) 7.3±0.76µs 7.7±0.39µs -5.19%
Array access (Full) 242.0±20.78µs 240.4±9.83µs +0.67%
Array creation (Execution) 2.6±0.11ms 2.9±0.27ms -10.34%
Array creation (Full) 3.2±0.23ms 3.1±0.09ms +3.23%
Array pop (Execution) 927.3±49.74µs 943.4±63.23µs -1.71%
Array pop (Full) 1455.4±142.95µs 1359.8±61.40µs +7.03%
Boolean Object Access (Execution) 4.0±0.22µs 4.0±0.29µs 0.00%
Boolean Object Access (Full) 232.4±10.45µs 232.1±8.97µs +0.13%
Create Realm 399.3±21.34ns 397.9±20.96ns +0.35%
Dynamic Object Property Access (Execution) 4.8±0.29µs 5.1±0.38µs -5.88%
Dynamic Object Property Access (Full) 216.5±9.85µs 234.8±12.55µs -7.79%
Expression (Lexer) 1947.3±81.14ns 2.1±0.07µs -7.27%
Expression (Parser) 5.1±0.41µs 4.7±0.28µs +8.51%
Fibonacci (Execution) 822.0±119.37µs 881.4±66.95µs -6.74%
Fibonacci (Full) 1053.6±73.33µs 1129.9±41.33µs -6.75%
For loop (Execution) 18.7±0.77µs 19.8±1.25µs -5.56%
For loop (Full) 238.9±14.02µs 251.0±17.72µs -4.82%
For loop (Lexer) 4.8±0.30µs 4.6±0.22µs +4.35%
For loop (Parser) 12.1±0.62µs 12.6±0.60µs -3.97%
Goal Symbols (Parser) 7.1±0.29µs 7.4±0.44µs -4.05%
Hello World (Lexer) 740.0±60.00ns 730.2±28.60ns +1.34%
Hello World (Parser) 2.0±0.14µs 1914.2±85.28ns +4.48%
Long file (Parser) 5.6±0.21ms 5.6±0.14ms 0.00%
Number Object Access (Execution) 3.1±0.23µs 3.4±0.27µs -8.82%
Number Object Access (Full) 221.7±15.36µs 233.2±22.64µs -4.93%
Object Creation (Execution) 3.9±0.22µs 4.2±0.39µs -7.14%
Object Creation (Full) 271.5±19.42µs 281.8±15.08µs -3.66%
RegExp (Execution) 58.5±3.97µs 59.2±4.78µs -1.18%
RegExp (Full) 348.1±22.34µs 366.1±15.38µs -4.92%
RegExp Literal (Execution) 60.8±3.67µs 63.2±6.97µs -3.80%
RegExp Literal (Full) 311.3±16.16µs 315.0±29.11µs -1.17%
RegExp Literal Creation (Execution) 57.9±2.88µs 63.2±4.60µs -8.39%
RegExp Literal Creation (Full) 348.1±18.50µs 391.9±30.23µs -11.18%
Static Object Property Access (Execution) 4.3±0.23µs 4.6±0.43µs -6.52%
Static Object Property Access (Full) 216.4±10.21µs 238.4±15.19µs -9.23%
String Object Access (Execution) 5.8±0.40µs 6.6±0.66µs -12.12%
String Object Access (Full) 232.2±11.89µs 230.7±9.44µs +0.65%
String comparison (Execution) 5.3±0.25µs 5.4±0.36µs -1.85%
String comparison (Full) 237.2±21.39µs 236.1±15.06µs +0.47%
String concatenation (Execution) 4.2±0.21µs 4.3±0.32µs -2.33%
String concatenation (Full) 233.5±15.03µs 227.0±11.90µs +2.86%
String copy (Execution) 3.2±0.15µs 3.6±0.22µs -11.11%
String copy (Full) 224.2±13.39µs 227.2±11.89µs -1.32%
Symbols (Execution) 2.7±0.19µs 2.9±0.22µs -6.90%
Symbols (Full) 196.6±12.99µs 207.2±14.75µs -5.12%

@github-actions
Copy link

Benchmark for e0031be

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 378.1±8.93ns 385.4±8.42ns -1.89%
Arithmetic operations (Full) 246.2±7.77µs 246.0±1.98µs +0.08%
Array access (Execution) 8.3±0.13µs 8.4±0.32µs -1.19%
Array access (Full) 262.2±6.40µs 264.4±5.06µs -0.83%
Array creation (Execution) 3.4±0.08ms 3.3±0.05ms +3.03%
Array creation (Full) 3.9±0.22ms 3.8±0.08ms +2.63%
Array pop (Execution) 1192.2±26.69µs 1168.7±14.33µs +2.01%
Array pop (Full) 1670.8±34.10µs 1602.0±36.53µs +4.29%
Boolean Object Access (Execution) 4.2±0.17µs 4.4±0.07µs -4.55%
Boolean Object Access (Full) 255.7±9.14µs 258.0±10.38µs -0.89%
Create Realm 500.0±41.29ns 471.5±6.51ns +6.04%
Dynamic Object Property Access (Execution) 5.1±0.15µs 5.0±0.10µs +2.00%
Dynamic Object Property Access (Full) 255.7±2.70µs 260.7±9.53µs -1.92%
Expression (Lexer) 2.4±0.07µs 2.4±0.05µs 0.00%
Expression (Parser) 5.5±0.35µs 5.5±0.16µs 0.00%
Fibonacci (Execution) 888.4±28.84µs 893.8±31.81µs -0.60%
Fibonacci (Full) 1191.6±58.52µs 1169.2±14.04µs +1.92%
For loop (Execution) 22.7±0.89µs 22.5±0.65µs +0.89%
For loop (Full) 279.8±7.57µs 277.4±4.94µs +0.87%
For loop (Lexer) 5.4±0.09µs 5.5±0.16µs -1.82%
For loop (Parser) 14.3±0.37µs 14.3±0.28µs 0.00%
Goal Symbols (Parser) 8.6±0.25µs 8.6±0.21µs 0.00%
Hello World (Lexer) 838.1±13.76ns 844.5±31.14ns -0.76%
Hello World (Parser) 2.1±0.03µs 2.1±0.03µs 0.00%
Long file (Parser) 6.4±0.15ms 6.4±0.13ms 0.00%
Number Object Access (Execution) 3.3±0.06µs 3.5±0.43µs -5.71%
Number Object Access (Full) 252.0±4.75µs 253.6±12.80µs -0.63%
Object Creation (Execution) 4.2±0.13µs 4.2±0.08µs 0.00%
Object Creation (Full) 306.1±6.26µs 306.3±9.29µs -0.07%
RegExp (Execution) 67.0±2.52µs 66.6±2.95µs +0.60%
RegExp (Full) 405.3±12.68µs 405.7±11.42µs -0.10%
RegExp Literal (Execution) 70.0±2.17µs 69.6±2.90µs +0.57%
RegExp Literal (Full) 332.8±11.30µs 334.4±8.42µs -0.48%
RegExp Literal Creation (Execution) 66.6±1.99µs 66.5±4.52µs +0.15%
RegExp Literal Creation (Full) 405.3±10.97µs 406.3±6.26µs -0.25%
Static Object Property Access (Execution) 4.6±0.48µs 4.5±0.28µs +2.22%
Static Object Property Access (Full) 255.0±11.55µs 255.2±12.13µs -0.08%
String Object Access (Execution) 6.4±0.09µs 6.5±0.10µs -1.54%
String Object Access (Full) 257.6±11.25µs 255.9±5.52µs +0.66%
String comparison (Execution) 5.9±0.12µs 5.9±0.31µs 0.00%
String comparison (Full) 261.9±8.58µs 255.7±2.71µs +2.42%
String concatenation (Execution) 4.8±0.23µs 4.7±0.06µs +2.13%
String concatenation (Full) 261.8±22.62µs 256.1±11.86µs +2.23%
String copy (Execution) 3.6±0.06µs 3.5±0.06µs +2.86%
String copy (Full) 247.4±4.01µs 247.2±3.77µs +0.08%
Symbols (Execution) 3.0±0.20µs 2.8±0.06µs +7.14%
Symbols (Full) 234.2±5.91µs 235.3±12.37µs -0.47%

@github-actions
Copy link

Benchmark for 9e9f5c1

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 367.9±16.73ns 316.5±38.19ns +16.24%
Arithmetic operations (Full) 249.8±11.58µs 252.6±13.62µs -1.11%
Array access (Execution) 8.7±0.55µs 8.6±0.39µs +1.16%
Array access (Full) 239.5±21.51µs 250.1±25.74µs -4.24%
Array creation (Execution) 3.1±0.19ms 3.2±0.19ms -3.13%
Array creation (Full) 3.4±0.35ms 3.4±0.32ms 0.00%
Array pop (Execution) 1165.9±119.01µs 938.9±45.78µs +24.18%
Array pop (Full) 1303.1±78.81µs 1313.9±111.56µs -0.82%
Boolean Object Access (Execution) 4.1±0.41µs 4.0±0.31µs +2.50%
Boolean Object Access (Full) 267.3±12.21µs 264.0±12.41µs +1.25%
Create Realm 452.7±38.29ns 453.4±48.06ns -0.15%
Dynamic Object Property Access (Execution) 4.6±0.41µs 5.3±0.37µs -13.21%
Dynamic Object Property Access (Full) 262.2±23.99µs 249.0±23.31µs +5.30%
Expression (Lexer) 2.4±0.17µs 2.4±0.20µs 0.00%
Expression (Parser) 5.3±0.36µs 5.4±0.41µs -1.85%
Fibonacci (Execution) 828.5±65.74µs 970.5±49.39µs -14.63%
Fibonacci (Full) 1082.9±83.21µs 1126.0±114.68µs -3.83%
For loop (Execution) 23.1±2.02µs 22.7±1.67µs +1.76%
For loop (Full) 253.6±25.80µs 239.2±19.10µs +6.02%
For loop (Lexer) 5.2±0.35µs 5.4±0.21µs -3.70%
For loop (Parser) 13.7±1.44µs 14.5±0.63µs -5.52%
Goal Symbols (Parser) 8.6±0.52µs 8.0±0.83µs +7.50%
Hello World (Lexer) 855.2±51.16ns 862.1±50.61ns -0.80%
Hello World (Parser) 2.1±0.11µs 2.3±0.11µs -8.70%
Long file (Parser) 6.3±0.56ms 6.7±0.25ms -5.97%
Number Object Access (Execution) 3.1±0.33µs 3.5±0.30µs -11.43%
Number Object Access (Full) 256.0±14.49µs 254.8±17.85µs +0.47%
Object Creation (Execution) 4.0±0.36µs 4.1±0.41µs -2.44%
Object Creation (Full) 303.3±29.52µs 279.9±29.38µs +8.36%
RegExp (Execution) 67.3±5.57µs 68.0±7.46µs -1.03%
RegExp (Full) 425.1±18.77µs 412.7±21.73µs +3.00%
RegExp Literal (Execution) 67.6±6.43µs 74.7±3.13µs -9.50%
RegExp Literal (Full) 297.7±24.58µs 343.6±21.22µs -13.36%
RegExp Literal Creation (Execution) 59.1±5.81µs 69.5±2.84µs -14.96%
RegExp Literal Creation (Full) 418.0±19.56µs 419.7±15.63µs -0.41%
Static Object Property Access (Execution) 4.8±0.35µs 4.8±0.36µs 0.00%
Static Object Property Access (Full) 249.1±24.26µs 265.7±11.97µs -6.25%
String Object Access (Execution) 6.8±0.27µs 6.8±0.35µs 0.00%
String Object Access (Full) 266.0±11.23µs 270.3±11.64µs -1.59%
String comparison (Execution) 6.1±0.25µs 6.4±0.28µs -4.69%
String comparison (Full) 263.6±12.80µs 260.6±15.32µs +1.15%
String concatenation (Execution) 4.7±0.57µs 4.8±0.54µs -2.08%
String concatenation (Full) 264.6±12.72µs 264.7±15.07µs -0.04%
String copy (Execution) 3.4±0.31µs 3.7±0.29µs -8.11%
String copy (Full) 255.4±13.92µs 257.2±17.29µs -0.70%
Symbols (Execution) 2.7±0.25µs 3.1±0.24µs -12.90%
Symbols (Full) 233.9±19.67µs 227.1±18.62µs +2.99%

@github-actions
Copy link

Benchmark for 9e587b1

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 316.4±17.88ns 327.0±22.50ns -3.24%
Arithmetic operations (Full) 218.3±12.32µs 221.0±12.40µs -1.22%
Array access (Execution) 7.5±0.48µs 7.7±0.32µs -2.60%
Array access (Full) 236.5±12.99µs 237.1±12.18µs -0.25%
Array creation (Execution) 2.8±0.11ms 2.7±0.13ms +3.70%
Array creation (Full) 3.1±0.17ms 3.2±0.17ms -3.13%
Array pop (Execution) 951.5±50.18µs 987.8±56.47µs -3.67%
Array pop (Full) 1322.7±79.61µs 1370.0±90.28µs -3.45%
Boolean Object Access (Execution) 3.8±0.21µs 4.2±0.26µs -9.52%
Boolean Object Access (Full) 231.7±17.05µs 235.8±22.44µs -1.74%
Create Realm 406.9±23.98ns 432.9±32.85ns -6.01%
Dynamic Object Property Access (Execution) 4.7±0.28µs 5.0±0.26µs -6.00%
Dynamic Object Property Access (Full) 235.8±18.33µs 230.7±15.52µs +2.21%
Expression (Lexer) 2.1±0.14µs 2.1±0.11µs 0.00%
Expression (Parser) 4.6±0.28µs 4.6±0.30µs 0.00%
Fibonacci (Execution) 848.8±33.59µs 853.6±54.36µs -0.56%
Fibonacci (Full) 1112.0±58.87µs 1144.0±139.21µs -2.80%
For loop (Execution) 20.2±1.31µs 20.3±1.26µs -0.49%
For loop (Full) 247.7±13.24µs 243.0±14.11µs +1.93%
For loop (Lexer) 4.5±0.28µs 4.6±0.42µs -2.17%
For loop (Parser) 12.1±0.72µs 12.6±1.01µs -3.97%
Goal Symbols (Parser) 7.7±3.06µs 7.5±0.38µs +2.67%
Hello World (Lexer) 726.4±49.83ns 750.0±65.94ns -3.15%
Hello World (Parser) 1951.9±139.46ns 1903.5±104.13ns +2.54%
Long file (Parser) 5.6±0.21ms 5.7±0.24ms -1.75%
Number Object Access (Execution) 3.0±0.17µs 3.0±0.18µs 0.00%
Number Object Access (Full) 224.4±11.56µs 233.7±24.43µs -3.98%
Object Creation (Execution) 4.0±0.23µs 3.9±0.23µs +2.56%
Object Creation (Full) 264.9±15.33µs 273.2±17.46µs -3.04%
RegExp (Execution) 60.8±3.84µs 61.7±4.02µs -1.46%
RegExp (Full) 367.2±22.82µs 360.2±23.03µs +1.94%
RegExp Literal (Execution) 64.7±3.56µs 62.0±3.58µs +4.35%
RegExp Literal (Full) 297.4±18.96µs 299.0±16.76µs -0.54%
RegExp Literal Creation (Execution) 60.3±3.98µs 61.3±4.09µs -1.63%
RegExp Literal Creation (Full) 354.6±18.45µs 350.0±19.33µs +1.31%
Static Object Property Access (Execution) 4.3±0.30µs 4.3±0.26µs 0.00%
Static Object Property Access (Full) 232.1±12.59µs 228.9±13.26µs +1.40%
String Object Access (Execution) 5.9±0.52µs 6.1±0.33µs -3.28%
String Object Access (Full) 228.2±10.47µs 232.6±14.46µs -1.89%
String comparison (Execution) 5.4±0.34µs 5.4±0.28µs 0.00%
String comparison (Full) 230.2±10.73µs 230.4±13.16µs -0.09%
String concatenation (Execution) 4.4±0.41µs 4.4±0.35µs 0.00%
String concatenation (Full) 223.6±12.17µs 232.0±11.25µs -3.62%
String copy (Execution) 3.2±0.17µs 3.4±0.21µs -5.88%
String copy (Full) 229.6±13.87µs 228.3±24.42µs +0.57%
Symbols (Execution) 2.7±0.23µs 2.7±0.18µs 0.00%
Symbols (Full) 203.8±12.33µs 218.2±14.49µs -6.60%

@github-actions
Copy link

Benchmark for 8141e96

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 371.8±16.02ns 372.5±19.46ns -0.19%
Arithmetic operations (Full) 254.8±11.89µs 252.8±7.49µs +0.79%
Array access (Execution) 8.7±0.26µs 8.8±0.36µs -1.14%
Array access (Full) 283.2±11.33µs 286.3±11.97µs -1.08%
Array creation (Execution) 3.2±0.09ms 3.2±0.11ms 0.00%
Array creation (Full) 3.7±0.09ms 3.7±0.14ms 0.00%
Array pop (Execution) 1135.2±49.65µs 1152.1±54.86µs -1.47%
Array pop (Full) 1584.8±65.86µs 1558.8±55.72µs +1.67%
Boolean Object Access (Execution) 4.4±0.18µs 4.6±0.23µs -4.35%
Boolean Object Access (Full) 270.1±12.13µs 273.9±10.13µs -1.39%
Create Realm 487.9±22.16ns 477.2±17.85ns +2.24%
Dynamic Object Property Access (Execution) 5.4±0.23µs 5.5±0.23µs -1.82%
Dynamic Object Property Access (Full) 270.2±10.42µs 272.4±9.99µs -0.81%
Expression (Lexer) 2.5±0.10µs 2.5±0.13µs 0.00%
Expression (Parser) 5.5±0.23µs 5.5±0.22µs 0.00%
Fibonacci (Execution) 997.2±33.27µs 994.9±33.22µs +0.23%
Fibonacci (Full) 1308.1±48.62µs 1367.7±71.93µs -4.36%
For loop (Execution) 24.7±0.97µs 23.9±1.05µs +3.35%
For loop (Full) 297.7±15.87µs 288.4±9.79µs +3.22%
For loop (Lexer) 5.4±0.18µs 5.3±0.18µs +1.89%
For loop (Parser) 14.8±0.56µs 14.8±0.51µs 0.00%
Goal Symbols (Parser) 8.6±0.31µs 8.7±0.39µs -1.15%
Hello World (Lexer) 862.5±27.17ns 867.0±34.04ns -0.52%
Hello World (Parser) 2.2±0.09µs 2.2±0.09µs 0.00%
Long file (Parser) 6.7±0.14ms 6.6±0.20ms +1.52%
Number Object Access (Execution) 3.6±0.20µs 3.5±0.13µs +2.86%
Number Object Access (Full) 264.6±11.98µs 261.8±12.42µs +1.07%
Object Creation (Execution) 4.8±0.19µs 4.6±0.14µs +4.35%
Object Creation (Full) 325.7±13.23µs 314.1±13.20µs +3.69%
RegExp (Execution) 72.4±4.39µs 71.3±3.24µs +1.54%
RegExp (Full) 425.7±15.90µs 422.0±13.73µs +0.88%
RegExp Literal (Execution) 75.2±4.07µs 74.7±3.83µs +0.67%
RegExp Literal (Full) 352.0±16.87µs 352.9±15.84µs -0.26%
RegExp Literal Creation (Execution) 71.5±3.72µs 70.5±2.31µs +1.42%
RegExp Literal Creation (Full) 430.3±23.39µs 420.5±21.70µs +2.33%
Static Object Property Access (Execution) 5.0±0.24µs 4.8±0.17µs +4.17%
Static Object Property Access (Full) 277.0±13.29µs 264.6±11.98µs +4.69%
String Object Access (Execution) 6.8±0.24µs 6.9±0.26µs -1.45%
String Object Access (Full) 267.1±8.59µs 266.9±10.49µs +0.07%
String comparison (Execution) 6.2±0.26µs 6.2±0.26µs 0.00%
String comparison (Full) 267.5±8.50µs 273.6±12.47µs -2.23%
String concatenation (Execution) 5.2±0.22µs 5.2±0.23µs 0.00%
String concatenation (Full) 268.9±12.38µs 263.0±9.79µs +2.24%
String copy (Execution) 3.9±0.14µs 3.8±0.20µs +2.63%
String copy (Full) 257.5±8.91µs 267.0±11.58µs -3.56%
Symbols (Execution) 3.2±0.11µs 3.2±0.10µs 0.00%
Symbols (Full) 244.1±9.38µs 241.9±7.36µs +0.91%

@HalidOdat HalidOdat marked this pull request as ready for review August 13, 2020 00:12
@github-actions
Copy link

Benchmark for 155021b

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 366.4±18.89ns 372.4±15.39ns -1.61%
Arithmetic operations (Full) 265.7±10.79µs 253.2±13.03µs +4.94%
Array access (Execution) 8.8±0.32µs 8.8±0.48µs 0.00%
Array access (Full) 276.1±13.27µs 283.7±16.27µs -2.68%
Array creation (Execution) 3.3±0.11ms 3.2±0.09ms +3.13%
Array creation (Full) 3.7±0.12ms 3.7±0.13ms 0.00%
Array pop (Execution) 1176.5±55.66µs 1164.0±52.63µs +1.07%
Array pop (Full) 1572.0±66.97µs 1563.5±56.13µs +0.54%
Boolean Object Access (Execution) 4.5±0.20µs 4.5±0.23µs 0.00%
Boolean Object Access (Full) 279.8±14.38µs 270.2±14.67µs +3.55%
Create Realm 491.0±17.26ns 460.8±18.33ns +6.55%
Dynamic Object Property Access (Execution) 5.5±0.28µs 5.5±0.31µs 0.00%
Dynamic Object Property Access (Full) 275.0±12.40µs 272.8±16.17µs +0.81%
Expression (Lexer) 2.5±0.11µs 2.5±0.12µs 0.00%
Expression (Parser) 5.7±0.27µs 5.3±0.22µs +7.55%
Fibonacci (Execution) 972.1±26.63µs 994.6±47.50µs -2.26%
Fibonacci (Full) 1292.8±71.33µs 1309.2±74.03µs -1.25%
For loop (Execution) 23.4±1.21µs 23.9±0.83µs -2.09%
For loop (Full) 293.9±18.04µs 296.6±15.75µs -0.91%
For loop (Lexer) 5.4±0.28µs 5.4±0.25µs 0.00%
For loop (Parser) 15.0±0.79µs 14.8±0.77µs +1.35%
Goal Symbols (Parser) 8.9±0.31µs 8.9±0.52µs 0.00%
Hello World (Lexer) 859.9±44.18ns 873.7±38.76ns -1.58%
Hello World (Parser) 2.3±0.10µs 2.2±0.13µs +4.55%
Long file (Parser) 6.7±0.24ms 6.6±0.17ms +1.52%
Number Object Access (Execution) 3.6±0.17µs 3.5±0.15µs +2.86%
Number Object Access (Full) 272.9±11.54µs 266.3±10.94µs +2.48%
Object Creation (Execution) 4.6±0.42µs 4.6±0.21µs 0.00%
Object Creation (Full) 324.2±12.97µs 322.1±11.58µs +0.65%
RegExp (Execution) 69.7±3.47µs 72.0±6.31µs -3.19%
RegExp (Full) 423.5±15.87µs 422.8±18.97µs +0.17%
RegExp Literal (Execution) 73.6±3.13µs 73.7±2.98µs -0.14%
RegExp Literal (Full) 352.1±11.99µs 354.3±13.61µs -0.62%
RegExp Literal Creation (Execution) 71.8±3.15µs 71.1±3.18µs +0.98%
RegExp Literal Creation (Full) 426.6±22.56µs 423.4±22.42µs +0.76%
Static Object Property Access (Execution) 5.0±0.75µs 5.0±0.23µs 0.00%
Static Object Property Access (Full) 270.9±11.89µs 273.9±11.03µs -1.10%
String Object Access (Execution) 6.7±0.31µs 7.8±0.74µs -14.10%
String Object Access (Full) 285.8±12.39µs 268.2±9.81µs +6.56%
String comparison (Execution) 6.2±0.32µs 6.4±0.35µs -3.13%
String comparison (Full) 280.0±11.86µs 273.3±19.01µs +2.45%
String concatenation (Execution) 5.2±0.21µs 5.3±0.25µs -1.89%
String concatenation (Full) 265.6±10.27µs 271.0±18.04µs -1.99%
String copy (Execution) 3.8±0.16µs 3.8±0.18µs 0.00%
String copy (Full) 269.0±9.39µs 265.4±14.45µs +1.36%
Symbols (Execution) 3.2±0.16µs 3.1±0.19µs +3.23%
Symbols (Full) 242.4±8.85µs 244.6±9.58µs -0.90%

@github-actions
Copy link

Benchmark for c58b480

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 366.8±15.46ns 421.2±21.56ns -12.92%
Arithmetic operations (Full) 255.1±15.90µs 264.9±13.84µs -3.70%
Array access (Execution) 8.7±0.34µs 8.8±0.61µs -1.14%
Array access (Full) 279.5±11.91µs 282.9±16.87µs -1.20%
Array creation (Execution) 3.3±0.15ms 3.2±0.15ms +3.13%
Array creation (Full) 3.7±0.14ms 3.6±0.14ms +2.78%
Array pop (Execution) 1195.7±83.37µs 1161.0±71.33µs +2.99%
Array pop (Full) 1588.4±75.45µs 1574.4±83.04µs +0.89%
Boolean Object Access (Execution) 4.4±0.23µs 4.5±0.29µs -2.22%
Boolean Object Access (Full) 266.4±17.84µs 270.0±12.88µs -1.33%
Create Realm 464.8±26.12ns 457.0±22.50ns +1.71%
Dynamic Object Property Access (Execution) 5.5±0.32µs 5.6±0.41µs -1.79%
Dynamic Object Property Access (Full) 277.8±17.73µs 276.9±22.96µs +0.33%
Expression (Lexer) 2.4±0.15µs 2.4±0.14µs 0.00%
Expression (Parser) 5.4±0.34µs 5.5±0.35µs -1.82%
Fibonacci (Execution) 984.2±51.23µs 972.0±46.51µs +1.26%
Fibonacci (Full) 1299.1±63.24µs 1306.0±69.11µs -0.53%
For loop (Execution) 23.6±1.20µs 24.2±1.84µs -2.48%
For loop (Full) 298.8±19.12µs 289.1±13.51µs +3.36%
For loop (Lexer) 5.3±0.28µs 5.4±0.24µs -1.85%
For loop (Parser) 14.4±0.78µs 15.0±1.14µs -4.00%
Goal Symbols (Parser) 8.7±0.49µs 8.7±0.47µs 0.00%
Hello World (Lexer) 842.7±44.86ns 854.4±37.59ns -1.37%
Hello World (Parser) 2.2±0.11µs 2.2±0.10µs 0.00%
Long file (Parser) 6.6±0.29ms 6.6±0.18ms 0.00%
Number Object Access (Execution) 3.5±0.14µs 3.9±0.48µs -10.26%
Number Object Access (Full) 265.9±17.63µs 269.2±12.48µs -1.23%
Object Creation (Execution) 4.5±0.21µs 4.8±0.30µs -6.25%
Object Creation (Full) 320.8±15.61µs 326.3±12.53µs -1.69%
RegExp (Execution) 69.9±4.84µs 72.0±5.36µs -2.92%
RegExp (Full) 438.6±33.22µs 439.5±25.19µs -0.20%
RegExp Literal (Execution) 73.5±3.90µs 75.5±4.19µs -2.65%
RegExp Literal (Full) 355.0±21.28µs 353.9±22.43µs +0.31%
RegExp Literal Creation (Execution) 67.9±3.22µs 72.0±4.51µs -5.69%
RegExp Literal Creation (Full) 421.2±21.95µs 429.4±27.94µs -1.91%
Static Object Property Access (Execution) 4.8±0.23µs 5.1±0.46µs -5.88%
Static Object Property Access (Full) 273.0±12.90µs 272.6±11.92µs +0.15%
String Object Access (Execution) 6.9±0.40µs 6.9±0.41µs 0.00%
String Object Access (Full) 267.5±15.51µs 277.5±16.80µs -3.60%
String comparison (Execution) 6.4±0.44µs 6.4±0.37µs 0.00%
String comparison (Full) 276.5±23.50µs 273.9±15.37µs +0.95%
String concatenation (Execution) 5.3±0.41µs 5.2±0.28µs +1.92%
String concatenation (Full) 266.9±16.52µs 272.1±11.24µs -1.91%
String copy (Execution) 3.8±0.18µs 3.8±0.20µs 0.00%
String copy (Full) 258.5±13.86µs 263.7±18.64µs -1.97%
Symbols (Execution) 3.1±0.19µs 3.2±0.17µs -3.13%
Symbols (Full) 245.6±12.14µs 248.9±15.82µs -1.33%

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.

I like it, just check my comments to see if it can be improved :)

boa/src/builtins/date/tests.rs Show resolved Hide resolved
boa/src/builtins/number/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/value/display.rs Show resolved Hide resolved
@HalidOdat HalidOdat requested a review from Razican August 15, 2020 12:20
@github-actions
Copy link

Benchmark for 73c9811

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 355.1±12.18ns 352.3±15.19ns +0.79%
Arithmetic operations (Full) 225.7±15.29µs 222.9±7.18µs +1.26%
Array access (Execution) 7.7±0.21µs 7.5±0.26µs +2.67%
Array access (Full) 245.3±8.70µs 238.2±9.91µs +2.98%
Array creation (Execution) 3.2±0.09ms 3.0±0.06ms +6.67%
Array creation (Full) 3.6±0.08ms 3.4±0.08ms +5.88%
Array pop (Execution) 1102.4±52.65µs 1088.1±44.15µs +1.31%
Array pop (Full) 1504.7±32.34µs 1449.2±53.83µs +3.83%
Boolean Object Access (Execution) 4.0±0.13µs 4.0±0.15µs 0.00%
Boolean Object Access (Full) 228.8±9.43µs 230.9±10.57µs -0.91%
Create Realm 449.9±22.76ns 440.9±23.33ns +2.04%
Dynamic Object Property Access (Execution) 4.6±0.16µs 4.6±0.17µs 0.00%
Dynamic Object Property Access (Full) 233.9±7.96µs 239.5±11.75µs -2.34%
Expression (Lexer) 2.2±0.10µs 2.2±0.14µs 0.00%
Expression (Parser) 5.0±0.18µs 5.1±0.28µs -1.96%
Fibonacci (Execution) 845.6±26.30µs 829.7±29.27µs +1.92%
Fibonacci (Full) 1121.0±58.98µs 1073.1±63.60µs +4.46%
For loop (Execution) 21.3±0.87µs 21.0±0.73µs +1.43%
For loop (Full) 255.3±8.93µs 250.0±9.97µs +2.12%
For loop (Lexer) 4.9±0.25µs 4.9±0.25µs 0.00%
For loop (Parser) 13.2±0.46µs 12.8±0.48µs +3.12%
Goal Symbols (Parser) 7.8±0.26µs 7.9±0.37µs -1.27%
Hello World (Lexer) 777.1±38.11ns 748.4±24.01ns +3.83%
Hello World (Parser) 2.0±0.06µs 1995.4±87.10ns +0.23%
Long file (Parser) 5.9±0.19ms 5.9±0.16ms 0.00%
Number Object Access (Execution) 3.1±0.07µs 3.1±0.20µs 0.00%
Number Object Access (Full) 228.6±6.90µs 229.1±10.97µs -0.22%
Object Creation (Execution) 4.0±0.11µs 3.8±0.16µs +5.26%
Object Creation (Full) 278.9±9.80µs 274.1±9.91µs +1.75%
RegExp (Execution) 60.9±2.74µs 59.9±2.80µs +1.67%
RegExp (Full) 379.9±11.76µs 360.8±12.20µs +5.29%
RegExp Literal (Execution) 63.6±2.74µs 62.4±2.64µs +1.92%
RegExp Literal (Full) 305.7±12.80µs 306.1±12.51µs -0.13%
RegExp Literal Creation (Execution) 62.0±1.98µs 59.0±2.08µs +5.08%
RegExp Literal Creation (Full) 380.2±18.96µs 361.9±13.09µs +5.06%
Static Object Property Access (Execution) 4.1±0.15µs 4.2±0.27µs -2.38%
Static Object Property Access (Full) 231.7±12.49µs 234.7±9.99µs -1.28%
String Object Access (Execution) 6.0±0.20µs 6.0±0.27µs 0.00%
String Object Access (Full) 230.5±10.80µs 233.3±7.96µs -1.20%
String comparison (Execution) 5.4±0.19µs 5.4±0.21µs 0.00%
String comparison (Full) 229.5±7.49µs 231.3±8.24µs -0.78%
String concatenation (Execution) 4.4±0.11µs 4.4±0.13µs 0.00%
String concatenation (Full) 226.7±7.73µs 233.9±12.16µs -3.08%
String copy (Execution) 3.3±0.10µs 3.4±0.21µs -2.94%
String copy (Full) 220.7±7.80µs 221.9±7.94µs -0.54%
Symbols (Execution) 2.7±0.09µs 2.6±0.10µs +3.85%
Symbols (Full) 214.8±6.95µs 216.5±11.34µs -0.79%

@HalidOdat
Copy link
Member Author

If everything is ok with this PR could we merge this, it's blocking me on some PRs

@HalidOdat HalidOdat added the API label Aug 15, 2020
@HalidOdat
Copy link
Member Author

Lets merge this merging this :)

@HalidOdat HalidOdat merged commit c5b708b into master Aug 15, 2020
@HalidOdat HalidOdat deleted the move-methods-to-value branch August 15, 2020 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in passing string value to function of type NativeFunctionData
2 participants