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

Refactor JavaScript symbol rust type #1382

Merged
merged 1 commit into from
Jul 17, 2021
Merged

Refactor JavaScript symbol rust type #1382

merged 1 commit into from
Jul 17, 2021

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Jun 30, 2021

Changes:

  • Rename Symbol struct to Inner, since that is what it is the inner data of a JavaScript symbol. And it doesn't really make sense to have two symbol types.
  • Rename RcSymbol => JsSymbol (Js prefix for JavaScript rust types #1376)
  • Removed Context::construct_symbol(description) since it's simpler to call JsSymbol::new(description).
  • Reexport JsSymbol to root level.

@HalidOdat HalidOdat added technical debt execution Issues or PRs related to code execution labels Jun 30, 2021
@HalidOdat HalidOdat added this to the v0.13.0 milestone Jun 30, 2021
@github-actions
Copy link

github-actions bot commented Jun 30, 2021

Test262 conformance changes:

Test result master count PR count difference
Total 78,897 78,897 0
Passed 27,954 27,954 0
Ignored 15,616 15,616 0
Failed 35,327 35,327 0
Panics 0 0 0
Conformance 35.43% 35.43% 0.00%

@github-actions
Copy link

Benchmark for c6de915

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 362.8±6.27ns 369.1±6.95ns -1.71%
Arithmetic operations (Full) 268.4±5.80µs 271.0±8.07µs -0.96%
Array access (Execution) 6.2±0.13µs 6.4±0.11µs -3.13%
Array access (Full) 294.4±5.56µs 299.1±8.77µs -1.57%
Array creation (Execution) 2.7±0.06ms 3.0±0.06ms -10.00%
Array creation (Full) 3.1±0.05ms 3.3±0.06ms -6.06%
Array pop (Execution) 900.0±18.53µs 945.8±22.50µs -4.84%
Array pop (Full) 1385.2±27.95µs 1436.8±28.67µs -3.59%
Boolean Object Access (Execution) 5.4±0.14µs 5.2±0.11µs +3.85%
Boolean Object Access (Full) 288.0±6.45µs 291.6±5.82µs -1.23%
Clean js (Execution) 632.5±16.14µs 633.8±11.69µs -0.21%
Clean js (Full) 936.3±24.40µs 963.1±22.82µs -2.78%
Clean js (Parser) 40.2±0.58µs 39.3±1.04µs +2.29%
Create Realm 411.6±7.95ns 430.7±8.69ns -4.43%
Dynamic Object Property Access (Execution) 5.2±0.09µs 5.1±0.13µs +1.96%
Dynamic Object Property Access (Full) 289.8±6.61µs 292.2±7.72µs -0.82%
Expression (Parser) 6.9±0.16µs 7.0±0.11µs -1.43%
Fibonacci (Execution) 742.6±14.00µs 750.4±13.59µs -1.04%
Fibonacci (Full) 1060.6±17.32µs 1052.3±25.38µs +0.79%
For loop (Execution) 21.8±0.51µs 21.7±0.45µs +0.46%
For loop (Full) 303.0±7.32µs 306.7±5.65µs -1.21%
For loop (Parser) 18.9±0.58µs 19.4±0.43µs -2.58%
Goal Symbols (Parser) 14.2±0.17µs 13.9±0.27µs +2.16%
Hello World (Parser) 3.8±0.13µs 3.8±0.09µs 0.00%
Long file (Parser) 792.2±10.11ns 780.9±16.03ns +1.45%
Mini js (Execution) 563.6±20.81µs 569.5±14.02µs -1.04%
Mini js (Full) 878.4±14.79µs 884.4±16.87µs -0.68%
Mini js (Parser) 35.2±0.48µs 34.5±0.81µs +2.03%
Number Object Access (Execution) 4.3±0.05µs 4.1±0.14µs +4.88%
Number Object Access (Full) 281.3±8.65µs 290.1±5.87µs -3.03%
Object Creation (Execution) 4.4±0.09µs 4.5±0.09µs -2.22%
Object Creation (Full) 285.4±6.18µs 287.9±5.89µs -0.87%
RegExp (Execution) 11.0±0.21µs 11.5±0.26µs -4.35%
RegExp (Full) 289.5±6.34µs 296.9±5.27µs -2.49%
RegExp Literal (Execution) 11.0±0.20µs 11.5±0.25µs -4.35%
RegExp Literal (Full) 298.0±6.55µs 296.0±5.82µs +0.68%
RegExp Literal Creation (Execution) 9.9±0.12µs 10.0±0.22µs -1.00%
RegExp Literal Creation (Full) 288.3±5.77µs 296.8±5.47µs -2.86%
Static Object Property Access (Execution) 4.6±0.08µs 4.7±0.12µs -2.13%
Static Object Property Access (Full) 287.6±7.06µs 302.7±3.31µs -4.99%
String Object Access (Execution) 7.4±0.18µs 7.2±0.16µs +2.78%
String Object Access (Full) 290.3±6.57µs 291.4±5.10µs -0.38%
String comparison (Execution) 6.5±0.13µs 6.5±0.14µs 0.00%
String comparison (Full) 291.4±7.40µs 292.0±6.85µs -0.21%
String concatenation (Execution) 5.2±0.11µs 5.3±0.09µs -1.89%
String concatenation (Full) 283.3±7.62µs 280.4±6.47µs +1.03%
String copy (Execution) 4.0±0.09µs 4.1±0.08µs -2.44%
String copy (Full) 276.1±5.68µs 283.6±4.51µs -2.64%
Symbols (Execution) 3.4±0.07µs 3.4±0.09µs 0.00%
Symbols (Full) 268.5±4.67µs 268.9±5.96µs -0.15%

@github-actions
Copy link

Benchmark for fd56a98

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 383.5±13.25ns 382.3±7.04ns +0.31%
Arithmetic operations (Full) 290.9±17.20µs 290.8±7.95µs +0.03%
Array access (Execution) 6.8±0.27µs 7.0±0.26µs -2.86%
Array access (Full) 321.2±12.64µs 317.7±9.63µs +1.10%
Array creation (Execution) 3.0±0.10ms 3.2±0.12ms -6.25%
Array creation (Full) 3.3±0.09ms 3.6±0.13ms -8.33%
Array pop (Execution) 970.3±42.58µs 1022.6±32.74µs -5.11%
Array pop (Full) 1480.7±45.56µs 1558.0±47.13µs -4.96%
Boolean Object Access (Execution) 5.8±0.22µs 5.6±0.16µs +3.57%
Boolean Object Access (Full) 308.4±10.73µs 312.6±10.68µs -1.34%
Clean js (Execution) 677.2±23.26µs 685.5±24.29µs -1.21%
Clean js (Full) 1016.7±48.35µs 1037.9±31.49µs -2.04%
Clean js (Parser) 42.8±1.96µs 42.0±0.75µs +1.90%
Create Realm 434.8±13.58ns 458.2±15.60ns -5.11%
Dynamic Object Property Access (Execution) 5.6±0.23µs 5.5±0.20µs +1.82%
Dynamic Object Property Access (Full) 316.6±10.34µs 312.8±9.94µs +1.21%
Expression (Parser) 7.4±0.19µs 7.5±0.57µs -1.33%
Fibonacci (Execution) 791.9±21.76µs 788.8±12.86µs +0.39%
Fibonacci (Full) 1134.5±28.59µs 1139.0±35.80µs -0.40%
For loop (Execution) 23.1±0.62µs 23.4±0.82µs -1.28%
For loop (Full) 329.5±16.65µs 327.0±12.44µs +0.76%
For loop (Parser) 20.6±0.67µs 20.4±0.89µs +0.98%
Goal Symbols (Parser) 15.2±0.60µs 14.9±0.42µs +2.01%
Hello World (Parser) 4.1±0.11µs 4.1±0.27µs 0.00%
Long file (Parser) 822.6±15.86ns 826.2±17.93ns -0.44%
Mini js (Execution) 612.2±18.98µs 611.5±23.23µs +0.11%
Mini js (Full) 938.9±29.42µs 952.5±28.58µs -1.43%
Mini js (Parser) 37.0±1.31µs 36.7±0.91µs +0.82%
Number Object Access (Execution) 4.5±0.15µs 4.4±0.15µs +2.27%
Number Object Access (Full) 308.8±11.44µs 304.0±8.72µs +1.58%
Object Creation (Execution) 4.7±0.15µs 4.8±0.24µs -2.08%
Object Creation (Full) 317.4±21.80µs 319.2±19.53µs -0.56%
RegExp (Execution) 11.8±0.39µs 12.3±0.29µs -4.07%
RegExp (Full) 322.6±10.45µs 313.9±10.73µs +2.77%
RegExp Literal (Execution) 11.7±0.40µs 12.4±0.43µs -5.65%
RegExp Literal (Full) 321.4±12.52µs 325.6±10.83µs -1.29%
RegExp Literal Creation (Execution) 10.2±0.39µs 10.7±0.32µs -4.67%
RegExp Literal Creation (Full) 314.0±9.18µs 319.7±18.81µs -1.78%
Static Object Property Access (Execution) 5.0±0.17µs 5.0±0.21µs 0.00%
Static Object Property Access (Full) 303.6±5.99µs 320.3±34.71µs -5.21%
String Object Access (Execution) 7.8±0.21µs 7.9±0.29µs -1.27%
String Object Access (Full) 316.0±8.31µs 316.4±9.66µs -0.13%
String comparison (Execution) 6.9±0.15µs 6.9±0.26µs 0.00%
String comparison (Full) 316.2±11.26µs 316.0±12.21µs +0.06%
String concatenation (Execution) 5.7±0.22µs 5.6±0.29µs +1.79%
String concatenation (Full) 308.3±38.01µs 309.7±13.69µs -0.45%
String copy (Execution) 4.2±0.15µs 4.3±0.17µs -2.33%
String copy (Full) 297.5±18.76µs 303.6±8.62µs -2.01%
Symbols (Execution) 3.6±0.06µs 3.7±0.18µs -2.70%
Symbols (Full) 286.6±7.72µs 289.3±8.22µs -0.93%

@github-actions
Copy link

github-actions bot commented Jul 5, 2021

Benchmark for ba8cb50

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 312.9±1.05ns 311.5±0.14ns +0.45%
Arithmetic operations (Full) 235.3±0.22µs 238.7±2.34µs -1.42%
Array access (Execution) 5.6±0.01µs 5.6±0.01µs 0.00%
Array access (Full) 258.7±0.37µs 261.4±0.68µs -1.03%
Array creation (Execution) 2.5±0.00ms 2.5±0.00ms 0.00%
Array creation (Full) 2.7±0.00ms 2.6±0.00ms +3.85%
Array pop (Execution) 797.3±3.64µs 791.6±3.58µs +0.72%
Array pop (Full) 1214.9±1.64µs 1184.5±1.41µs +2.57%
Boolean Object Access (Execution) 4.6±0.01µs 4.6±0.01µs 0.00%
Boolean Object Access (Full) 254.3±0.46µs 253.3±0.39µs +0.39%
Clean js (Execution) 547.9±3.56µs 541.4±2.86µs +1.20%
Clean js (Full) 834.1±2.47µs 829.2±2.40µs +0.59%
Clean js (Parser) 36.0±0.05µs 36.1±0.03µs -0.28%
Create Realm 356.2±0.18ns 364.0±0.36ns -2.14%
Dynamic Object Property Access (Execution) 4.6±0.01µs 4.5±0.01µs +2.22%
Dynamic Object Property Access (Full) 257.4±0.71µs 258.3±0.47µs -0.35%
Expression (Parser) 6.3±0.00µs 6.3±0.00µs 0.00%
Fibonacci (Execution) 646.7±0.60µs 649.3±1.28µs -0.40%
Fibonacci (Full) 929.0±2.38µs 934.4±1.37µs -0.58%
For loop (Execution) 18.7±0.09µs 18.7±0.06µs 0.00%
For loop (Full) 268.7±0.40µs 265.5±0.56µs +1.21%
For loop (Parser) 17.2±0.23µs 17.3±0.02µs -0.58%
Goal Symbols (Parser) 12.6±0.07µs 12.5±0.02µs +0.80%
Hello World (Parser) 3.4±0.01µs 3.4±0.01µs 0.00%
Long file (Parser) 731.2±4.03ns 734.0±1.38ns -0.38%
Mini js (Execution) 496.5±3.64µs 488.5±3.03µs +1.64%
Mini js (Full) 774.1±4.03µs 775.0±2.89µs -0.12%
Mini js (Parser) 31.5±0.03µs 31.4±0.02µs +0.32%
Number Object Access (Execution) 3.6±0.01µs 3.6±0.00µs 0.00%
Number Object Access (Full) 249.8±1.48µs 250.8±0.68µs -0.40%
Object Creation (Execution) 3.8±0.01µs 3.9±0.01µs -2.56%
Object Creation (Full) 254.3±0.53µs 251.9±0.62µs +0.95%
RegExp (Execution) 9.6±0.02µs 10.0±0.03µs -4.00%
RegExp (Full) 260.2±0.35µs 261.3±0.54µs -0.42%
RegExp Literal (Execution) 9.5±0.01µs 9.9±0.05µs -4.04%
RegExp Literal (Full) 264.3±0.63µs 264.1±0.68µs +0.08%
RegExp Literal Creation (Execution) 8.3±0.03µs 8.7±0.02µs -4.60%
RegExp Literal Creation (Full) 256.0±0.39µs 258.1±0.74µs -0.81%
Static Object Property Access (Execution) 4.0±0.01µs 4.0±0.01µs 0.00%
Static Object Property Access (Full) 254.7±0.54µs 255.9±0.33µs -0.47%
String Object Access (Execution) 6.3±0.01µs 6.3±0.01µs 0.00%
String Object Access (Full) 257.9±0.72µs 256.1±0.46µs +0.70%
String comparison (Execution) 5.6±0.02µs 5.7±0.01µs -1.75%
String comparison (Full) 254.2±0.29µs 251.5±0.50µs +1.07%
String concatenation (Execution) 4.5±0.01µs 4.6±0.01µs -2.17%
String concatenation (Full) 250.0±0.44µs 250.0±0.55µs 0.00%
String copy (Execution) 3.5±0.02µs 3.4±0.01µs +2.94%
String copy (Full) 245.5±0.50µs 245.0±0.40µs +0.20%
Symbols (Execution) 3.0±0.00µs 2.9±0.00µs +3.45%
Symbols (Full) 236.8±0.46µs 234.0±0.73µs +1.20%

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks!

boa/src/symbol.rs Show resolved Hide resolved
@HalidOdat HalidOdat merged commit ecd56ca into master Jul 17, 2021
@HalidOdat HalidOdat deleted the refactor/symbol branch July 17, 2021 09:59
@github-actions
Copy link

Benchmark for 230e339

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 312.4±0.19ns 317.9±0.15ns -1.73%
Arithmetic operations (Full) 244.6±0.35µs 239.8±0.25µs +2.00%
Array access (Execution) 5.6±0.02µs 5.6±0.02µs 0.00%
Array access (Full) 265.8±0.85µs 262.1±5.18µs +1.41%
Array creation (Execution) 2.4±0.01ms 2.6±0.00ms -7.69%
Array creation (Full) 2.7±0.00ms 2.8±0.03ms -3.57%
Array pop (Execution) 775.0±2.81µs 823.1±2.14µs -5.84%
Array pop (Full) 1200.6±1.45µs 1221.1±1.18µs -1.68%
Boolean Object Access (Execution) 4.6±0.00µs 4.6±0.01µs 0.00%
Boolean Object Access (Full) 259.1±0.54µs 256.9±0.30µs +0.86%
Clean js (Execution) 544.2±3.17µs 546.4±4.16µs -0.40%
Clean js (Full) 834.0±2.06µs 832.4±2.39µs +0.19%
Clean js (Parser) 36.1±0.04µs 36.0±0.04µs +0.28%
Create Realm 366.5±0.32ns 359.1±4.04ns +2.06%
Dynamic Object Property Access (Execution) 4.6±0.01µs 4.5±0.02µs +2.22%
Dynamic Object Property Access (Full) 262.1±0.42µs 258.7±0.64µs +1.31%
Expression (Parser) 6.0±0.00µs 6.0±0.02µs 0.00%
Fibonacci (Execution) 646.7±0.39µs 649.2±0.63µs -0.39%
Fibonacci (Full) 937.3±3.41µs 941.0±1.29µs -0.39%
For loop (Execution) 19.1±0.12µs 18.9±0.12µs +1.06%
For loop (Full) 272.4±0.74µs 271.2±0.50µs +0.44%
For loop (Parser) 17.3±0.02µs 17.2±0.02µs +0.58%
Goal Symbols (Parser) 12.4±0.02µs 12.4±0.01µs 0.00%
Hello World (Parser) 3.3±0.03µs 3.4±0.02µs -2.94%
Long file (Parser) 748.2±13.64ns 736.1±1.55ns +1.64%
Mini js (Execution) 491.6±2.87µs 494.8±3.63µs -0.65%
Mini js (Full) 776.1±1.72µs 779.1±2.67µs -0.39%
Mini js (Parser) 31.6±0.02µs 31.6±0.03µs 0.00%
Number Object Access (Execution) 3.6±0.01µs 3.6±0.01µs 0.00%
Number Object Access (Full) 257.6±0.33µs 252.5±0.32µs +2.02%
Object Creation (Execution) 3.8±0.01µs 3.9±0.01µs -2.56%
Object Creation (Full) 259.8±0.41µs 253.8±0.44µs +2.36%
RegExp (Execution) 11.1±0.04µs 11.0±0.06µs +0.91%
RegExp (Full) 267.9±0.91µs 262.1±0.52µs +2.21%
RegExp Literal (Execution) 11.0±0.07µs 11.0±0.06µs 0.00%
RegExp Literal (Full) 271.4±1.48µs 272.0±0.55µs -0.22%
RegExp Literal Creation (Execution) 8.2±0.02µs 8.5±0.03µs -3.53%
RegExp Literal Creation (Full) 263.9±0.59µs 259.4±0.62µs +1.73%
Static Object Property Access (Execution) 4.1±0.01µs 4.0±0.02µs +2.50%
Static Object Property Access (Full) 261.4±1.82µs 257.4±0.54µs +1.55%
String Object Access (Execution) 6.4±0.02µs 6.3±0.01µs +1.59%
String Object Access (Full) 263.8±0.35µs 260.0±0.31µs +1.46%
String comparison (Execution) 5.7±0.03µs 5.6±0.03µs +1.79%
String comparison (Full) 262.7±1.59µs 258.1±0.68µs +1.78%
String concatenation (Execution) 4.7±0.01µs 4.5±0.02µs +4.44%
String concatenation (Full) 255.4±2.65µs 252.5±0.36µs +1.15%
String copy (Execution) 3.5±0.03µs 3.4±0.01µs +2.94%
String copy (Full) 250.4±0.31µs 249.0±0.32µs +0.56%
Symbols (Execution) 3.1±0.02µs 3.0±0.01µs +3.33%
Symbols (Full) 240.6±0.44µs 238.6±0.57µs +0.84%

@github-actions
Copy link

Benchmark for cd489e8

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 371.7±21.13ns 369.8±19.57ns +0.51%
Arithmetic operations (Full) 321.7±14.19µs 309.7±17.81µs +3.87%
Array access (Execution) 7.5±1.19µs 7.3±0.42µs +2.74%
Array access (Full) 350.5±14.60µs 354.4±26.51µs -1.10%
Array creation (Execution) 2.7±0.13ms 2.8±0.13ms -3.57%
Array creation (Full) 3.2±0.22ms 3.2±0.15ms 0.00%
Array pop (Execution) 900.4±46.99µs 906.4±41.90µs -0.66%
Array pop (Full) 1470.1±92.44µs 1445.1±64.30µs +1.73%
Boolean Object Access (Execution) 5.9±0.27µs 6.0±0.50µs -1.67%
Boolean Object Access (Full) 337.4±15.41µs 324.0±19.01µs +4.14%
Clean js (Execution) 662.2±50.85µs 634.8±28.90µs +4.32%
Clean js (Full) 1035.9±76.88µs 981.2±45.40µs +5.57%
Clean js (Parser) 41.6±2.37µs 42.1±2.28µs -1.19%
Create Realm 444.9±24.30ns 457.7±21.39ns -2.80%
Dynamic Object Property Access (Execution) 6.1±0.25µs 6.1±0.31µs 0.00%
Dynamic Object Property Access (Full) 336.7±50.44µs 335.2±20.37µs +0.45%
Expression (Parser) 7.1±0.48µs 7.6±0.43µs -6.58%
Fibonacci (Execution) 871.1±35.89µs 876.3±50.87µs -0.59%
Fibonacci (Full) 1242.1±56.42µs 1270.9±112.03µs -2.27%
For loop (Execution) 23.4±1.20µs 23.4±1.26µs 0.00%
For loop (Full) 345.5±23.80µs 344.6±15.75µs +0.26%
For loop (Parser) 19.9±1.19µs 20.6±1.01µs -3.40%
Goal Symbols (Parser) 14.1±0.71µs 14.1±0.70µs 0.00%
Hello World (Parser) 4.0±0.16µs 4.0±0.22µs 0.00%
Long file (Parser) 798.7±35.35ns 808.6±35.89ns -1.22%
Mini js (Execution) 600.5±63.79µs 573.3±25.63µs +4.74%
Mini js (Full) 971.8±40.79µs 966.5±42.33µs +0.55%
Mini js (Parser) 36.1±1.78µs 36.9±1.41µs -2.17%
Number Object Access (Execution) 4.6±0.40µs 4.6±0.20µs 0.00%
Number Object Access (Full) 339.8±20.97µs 319.9±17.66µs +6.22%
Object Creation (Execution) 5.2±0.22µs 5.1±0.19µs +1.96%
Object Creation (Full) 333.4±18.28µs 328.8±17.40µs +1.40%
RegExp (Execution) 13.5±0.82µs 13.1±0.61µs +3.05%
RegExp (Full) 345.3±16.52µs 335.4±14.66µs +2.95%
RegExp Literal (Execution) 13.4±0.71µs 13.5±0.73µs -0.74%
RegExp Literal (Full) 359.1±44.25µs 353.6±20.57µs +1.56%
RegExp Literal Creation (Execution) 10.1±0.67µs 10.4±0.69µs -2.88%
RegExp Literal Creation (Full) 345.1±15.03µs 343.6±24.59µs +0.44%
Static Object Property Access (Execution) 5.5±0.29µs 5.4±0.33µs +1.85%
Static Object Property Access (Full) 331.6±15.52µs 337.9±21.48µs -1.86%
String Object Access (Execution) 8.2±0.57µs 7.9±0.38µs +3.80%
String Object Access (Full) 346.9±24.59µs 331.9±19.43µs +4.52%
String comparison (Execution) 7.2±0.43µs 7.7±4.48µs -6.49%
String comparison (Full) 338.1±17.29µs 331.8±21.80µs +1.90%
String concatenation (Execution) 5.9±0.29µs 5.7±0.38µs +3.51%
String concatenation (Full) 323.2±22.04µs 325.3±22.95µs -0.65%
String copy (Execution) 4.5±0.30µs 4.5±0.24µs 0.00%
String copy (Full) 317.4±12.61µs 325.0±17.88µs -2.34%
Symbols (Execution) 3.9±0.19µs 3.9±0.24µs 0.00%
Symbols (Full) 301.7±16.39µs 310.5±14.33µs -2.83%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execution Issues or PRs related to code execution technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants