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

Fix Array.prototype.filter #1272

Merged
merged 1 commit into from
May 25, 2021
Merged

Fix Array.prototype.filter #1272

merged 1 commit into from
May 25, 2021

Conversation

Razican
Copy link
Member

@Razican Razican commented May 22, 2021

This is a re-base of #1081.

@Razican Razican added the builtins PRs and Issues related to builtins/intrinsics label May 22, 2021
@Razican Razican added this to the v0.12.0 milestone May 22, 2021
@Razican Razican requested review from HalidOdat, RageKnify and tofpie May 22, 2021 09:46
@Razican Razican force-pushed the tofpie-fix-filter branch from 4a2c641 to 8c2add3 Compare May 22, 2021 10:00
@github-actions
Copy link

github-actions bot commented May 22, 2021

Test262 conformance changes:

Test result master count PR count difference
Total 78,873 78,873 0
Passed 26,498 26,616 +118
Ignored 15,604 15,604 0
Failed 36,771 36,653 -118
Panics 27 26 -1
Conformance 33.60% 33.75% +0.15%

@Razican Razican force-pushed the tofpie-fix-filter branch from 8c2add3 to 4760829 Compare May 22, 2021 10:07
@github-actions
Copy link

Benchmark for 2c5e3be

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 303.0±0.18ns 303.0±0.15ns 0.00%
Arithmetic operations (Full) 224.7±0.34µs 226.6±0.29µs -0.84%
Array access (Execution) 5.2±0.02µs 5.3±0.10µs -1.89%
Array access (Full) 247.4±0.47µs 247.5±0.64µs -0.04%
Array creation (Execution) 2.6±0.00ms 2.2±0.00ms +18.18%
Array creation (Full) 2.8±0.00ms 2.7±0.00ms +3.70%
Array pop (Execution) 815.1±1.91µs 733.7±2.23µs +11.09%
Array pop (Full) 1229.9±1.34µs 1188.0±1.43µs +3.53%
Boolean Object Access (Execution) 4.4±0.00µs 4.4±0.01µs 0.00%
Boolean Object Access (Full) 241.3±0.27µs 243.1±0.25µs -0.74%
Clean js (Execution) 561.2±4.21µs 550.4±3.40µs +1.96%
Clean js (Full) 827.9±3.26µs 833.1±3.04µs -0.62%
Clean js (Parser) 36.3±0.10µs 36.1±0.02µs +0.55%
Create Realm 372.4±2.45ns 358.3±0.44ns +3.94%
Dynamic Object Property Access (Execution) 4.2±0.01µs 4.2±0.01µs 0.00%
Dynamic Object Property Access (Full) 243.0±0.41µs 245.1±0.39µs -0.86%
Expression (Parser) 6.2±0.00µs 6.1±0.00µs +1.64%
Fibonacci (Execution) 638.7±1.59µs 640.6±1.57µs -0.30%
Fibonacci (Full) 896.9±1.06µs 902.4±1.04µs -0.61%
For loop (Execution) 18.5±0.02µs 18.3±0.07µs +1.09%
For loop (Full) 259.8±0.51µs 260.3±0.36µs -0.19%
For loop (Parser) 17.3±0.04µs 17.4±0.02µs -0.57%
Goal Symbols (Parser) 12.3±0.02µs 12.5±0.04µs -1.60%
Hello World (Parser) 3.4±0.01µs 3.4±0.01µs 0.00%
Long file (Parser) 696.8±11.58ns 704.3±2.24ns -1.06%
Mini js (Execution) 506.2±2.45µs 488.9±2.06µs +3.54%
Mini js (Full) 770.9±2.70µs 772.6±2.56µs -0.22%
Mini js (Parser) 31.5±0.04µs 31.5±0.02µs 0.00%
Number Object Access (Execution) 3.5±0.01µs 3.5±0.04µs 0.00%
Number Object Access (Full) 237.5±0.40µs 239.5±0.40µs -0.84%
Object Creation (Execution) 3.6±0.01µs 3.6±0.01µs 0.00%
Object Creation (Full) 241.4±0.45µs 240.3±0.27µs +0.46%
RegExp (Execution) 9.2±0.02µs 9.3±0.03µs -1.08%
RegExp (Full) 250.2±0.31µs 256.7±0.33µs -2.53%
RegExp Literal (Execution) 9.2±0.01µs 9.3±0.02µs -1.08%
RegExp Literal (Full) 250.3±0.67µs 251.3±0.32µs -0.40%
RegExp Literal Creation (Execution) 8.0±0.06µs 8.1±0.02µs -1.23%
RegExp Literal Creation (Full) 241.5±0.34µs 247.6±0.57µs -2.46%
Static Object Property Access (Execution) 3.8±0.02µs 3.9±0.01µs -2.56%
Static Object Property Access (Full) 240.4±0.57µs 242.9±0.31µs -1.03%
String Object Access (Execution) 6.1±0.06µs 6.3±0.03µs -3.17%
String Object Access (Full) 244.2±0.37µs 246.0±0.42µs -0.73%
String comparison (Execution) 5.5±0.01µs 5.5±0.01µs 0.00%
String comparison (Full) 242.4±0.30µs 243.9±0.42µs -0.62%
String concatenation (Execution) 4.4±0.01µs 4.4±0.01µs 0.00%
String concatenation (Full) 236.9±2.39µs 238.9±0.28µs -0.84%
String copy (Execution) 3.3±0.01µs 3.3±0.01µs 0.00%
String copy (Full) 233.2±1.86µs 236.9±0.24µs -1.56%
Symbols (Execution) 2.8±0.01µs 2.8±0.00µs 0.00%
Symbols (Full) 227.8±0.48µs 229.0±0.34µs -0.52%

@github-actions
Copy link

Benchmark for 5681893

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 357.3±3.81ns 359.2±6.95ns -0.53%
Arithmetic operations (Full) 266.6±5.18µs 271.7±3.93µs -1.88%
Array access (Execution) 6.0±0.07µs 6.1±0.07µs -1.64%
Array access (Full) 290.1±4.72µs 296.2±3.76µs -2.06%
Array creation (Execution) 3.0±0.03ms 2.7±0.03ms +11.11%
Array creation (Full) 3.3±0.04ms 3.1±0.03ms +6.45%
Array pop (Execution) 961.3±11.08µs 879.1±7.01µs +9.35%
Array pop (Full) 1447.4±28.66µs 1402.1±14.88µs +3.23%
Boolean Object Access (Execution) 5.3±0.07µs 5.2±0.05µs +1.92%
Boolean Object Access (Full) 285.1±3.25µs 290.0±4.52µs -1.69%
Clean js (Execution) 660.7±8.19µs 655.2±8.36µs +0.84%
Clean js (Full) 974.6±11.58µs 981.8±12.11µs -0.73%
Clean js (Parser) 40.2±0.48µs 40.6±0.50µs -0.99%
Create Realm 427.7±4.80ns 424.7±5.01ns +0.71%
Dynamic Object Property Access (Execution) 5.1±0.05µs 5.1±0.07µs 0.00%
Dynamic Object Property Access (Full) 290.0±2.25µs 287.3±3.35µs +0.94%
Expression (Parser) 7.2±0.08µs 7.3±0.14µs -1.37%
Fibonacci (Execution) 749.4±9.19µs 748.0±9.10µs +0.19%
Fibonacci (Full) 1058.7±13.10µs 1063.8±12.01µs -0.48%
For loop (Execution) 21.8±0.25µs 21.7±0.25µs +0.46%
For loop (Full) 302.7±3.42µs 306.4±5.75µs -1.21%
For loop (Parser) 19.7±0.24µs 19.7±0.19µs 0.00%
Goal Symbols (Parser) 14.0±0.18µs 14.4±0.14µs -2.78%
Hello World (Parser) 3.9±0.05µs 4.0±0.05µs -2.50%
Long file (Parser) 795.6±7.05ns 788.3±10.49ns +0.93%
Mini js (Execution) 601.2±7.05µs 581.7±7.12µs +3.35%
Mini js (Full) 904.3±11.86µs 908.0±11.69µs -0.41%
Mini js (Parser) 35.1±0.43µs 35.0±0.45µs +0.29%
Number Object Access (Execution) 4.1±0.05µs 4.0±0.05µs +2.50%
Number Object Access (Full) 281.2±2.80µs 285.4±2.88µs -1.47%
Object Creation (Execution) 4.2±0.05µs 4.2±0.06µs 0.00%
Object Creation (Full) 283.6±3.26µs 282.0±3.37µs +0.57%
RegExp (Execution) 11.0±0.11µs 11.0±0.12µs 0.00%
RegExp (Full) 297.5±3.02µs 302.1±3.23µs -1.52%
RegExp Literal (Execution) 11.0±0.15µs 10.8±0.12µs +1.85%
RegExp Literal (Full) 292.6±3.19µs 295.4±3.42µs -0.95%
RegExp Literal Creation (Execution) 9.4±0.09µs 9.5±0.12µs -1.05%
RegExp Literal Creation (Full) 290.0±3.43µs 294.4±2.19µs -1.49%
Static Object Property Access (Execution) 4.5±0.06µs 4.5±0.05µs 0.00%
Static Object Property Access (Full) 283.9±4.54µs 287.7±2.70µs -1.32%
String Object Access (Execution) 7.3±0.06µs 7.3±0.12µs 0.00%
String Object Access (Full) 287.8±3.93µs 293.3±3.74µs -1.88%
String comparison (Execution) 6.4±0.08µs 6.6±0.07µs -3.03%
String comparison (Full) 285.3±2.96µs 294.3±3.40µs -3.06%
String concatenation (Execution) 5.3±0.07µs 5.1±0.06µs +3.92%
String concatenation (Full) 276.8±3.16µs 288.8±13.36µs -4.16%
String copy (Execution) 3.9±0.04µs 3.9±0.04µs 0.00%
String copy (Full) 271.7±3.17µs 281.3±2.87µs -3.41%
Symbols (Execution) 3.3±0.04µs 3.3±0.04µs 0.00%
Symbols (Full) 268.5±3.05µs 272.0±3.08µs -1.29%

@Razican
Copy link
Member Author

Razican commented May 22, 2021

Seems that the array creation is slower. Maybe we can improve it somehow.

Copy link
Contributor

@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.

Minor nitpick

boa/src/builtins/map/mod.rs Outdated Show resolved Hide resolved
@Razican Razican mentioned this pull request May 22, 2021
Co-authored-by: tofpie <tofpie@users.noreply.github.com>
@Razican Razican force-pushed the tofpie-fix-filter branch from 4760829 to 6a31739 Compare May 24, 2021 17:27
@github-actions
Copy link

Benchmark for 82d687a

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 364.4±0.23ns 365.1±1.90ns -0.19%
Arithmetic operations (Full) 271.6±0.43µs 266.3±2.57µs +1.99%
Array access (Execution) 6.2±0.02µs 6.2±0.02µs 0.00%
Array access (Full) 300.8±0.44µs 291.9±2.87µs +3.05%
Array creation (Execution) 3.1±0.00ms 2.9±0.00ms +6.90%
Array creation (Full) 3.4±0.00ms 3.3±0.01ms +3.03%
Array pop (Execution) 978.4±2.10µs 930.6±3.34µs +5.14%
Array pop (Full) 1469.6±2.53µs 1435.6±8.81µs +2.37%
Boolean Object Access (Execution) 5.3±0.02µs 5.2±0.02µs +1.92%
Boolean Object Access (Full) 290.6±1.06µs 288.6±2.60µs +0.69%
Clean js (Execution) 668.6±3.60µs 659.0±4.63µs +1.46%
Clean js (Full) 994.8±4.72µs 976.5±7.11µs +1.87%
Clean js (Parser) 41.2±0.18µs 41.4±0.14µs -0.48%
Create Realm 431.0±0.27ns 426.5±7.01ns +1.06%
Dynamic Object Property Access (Execution) 5.2±0.03µs 5.0±0.03µs +4.00%
Dynamic Object Property Access (Full) 296.5±0.63µs 284.2±4.24µs +4.33%
Expression (Parser) 7.6±0.01µs 7.4±0.01µs +2.70%
Fibonacci (Execution) 759.7±1.94µs 755.5±3.57µs +0.56%
Fibonacci (Full) 1065.5±1.68µs 1053.4±11.87µs +1.15%
For loop (Execution) 21.9±0.06µs 21.6±0.26µs +1.39%
For loop (Full) 308.5±0.42µs 301.7±4.00µs +2.25%
For loop (Parser) 19.9±0.08µs 20.0±0.06µs -0.50%
Goal Symbols (Parser) 14.1±0.03µs 14.2±0.06µs -0.70%
Hello World (Parser) 4.0±0.01µs 4.0±0.02µs 0.00%
Long file (Parser) 804.1±3.03ns 794.8±5.92ns +1.17%
Mini js (Execution) 605.0±3.51µs 595.5±3.53µs +1.60%
Mini js (Full) 925.6±3.66µs 914.0±5.98µs +1.27%
Mini js (Parser) 36.1±0.10µs 36.2±0.26µs -0.28%
Number Object Access (Execution) 4.1±0.01µs 4.1±0.01µs 0.00%
Number Object Access (Full) 287.3±0.65µs 284.6±1.25µs +0.95%
Object Creation (Execution) 4.3±0.01µs 4.2±0.04µs +2.38%
Object Creation (Full) 290.9±2.69µs 284.9±1.93µs +2.11%
RegExp (Execution) 10.9±0.04µs 11.8±0.04µs -7.63%
RegExp (Full) 308.4±1.22µs 302.1±2.45µs +2.09%
RegExp Literal (Execution) 10.9±0.03µs 11.8±0.08µs -7.63%
RegExp Literal (Full) 301.1±0.72µs 296.0±0.91µs +1.72%
RegExp Literal Creation (Execution) 9.5±0.17µs 10.3±0.08µs -7.77%
RegExp Literal Creation (Full) 293.4±0.41µs 289.7±3.87µs +1.28%
Static Object Property Access (Execution) 4.6±0.02µs 4.5±0.05µs +2.22%
Static Object Property Access (Full) 290.6±0.86µs 284.8±1.47µs +2.04%
String Object Access (Execution) 7.3±0.02µs 7.2±0.05µs +1.39%
String Object Access (Full) 295.8±0.73µs 289.1±3.22µs +2.32%
String comparison (Execution) 6.5±0.03µs 6.5±0.04µs 0.00%
String comparison (Full) 295.1±2.55µs 286.7±3.27µs +2.93%
String concatenation (Execution) 5.2±0.02µs 5.2±0.04µs 0.00%
String concatenation (Full) 289.1±0.42µs 276.9±3.51µs +4.41%
String copy (Execution) 3.9±0.03µs 3.9±0.01µs 0.00%
String copy (Full) 283.0±3.94µs 278.1±1.88µs +1.76%
Symbols (Execution) 3.3±0.01µs 3.3±0.04µs 0.00%
Symbols (Full) 274.4±0.82µs 269.2±2.80µs +1.93%

@Razican Razican requested review from 0x7D2B, jasonwilliams and Lan2u May 24, 2021 20:43
@Razican Razican merged commit 68543e8 into master May 25, 2021
@Razican Razican deleted the tofpie-fix-filter branch May 25, 2021 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants