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

[Merged by Bors] - Fix String.prototype[@@iterator] #2800

Closed
wants to merge 1 commit into from

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Apr 10, 2023

It changes the following:

  • FixesString.prototype[@@iterator] so it calls RequireObjectCoercible and then ToString
  • Makes string iterator store a JsString which should be faster, instead of JsValue then calling ToString on every iteration

@HalidOdat HalidOdat added bug Something isn't working builtins PRs and Issues related to builtins/intrinsics run-benchmark Label used to run banchmarks on PRs labels Apr 10, 2023
@HalidOdat HalidOdat added this to the v0.17.0 milestone Apr 10, 2023
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 94,343 94,343 0
Passed 71,163 71,167 +4
Ignored 17,386 17,386 0
Failed 5,794 5,790 -4
Panics 0 0 0
Conformance 75.43% 75.43% +0.00%
Fixed tests (4):
test/built-ins/String/prototype/Symbol.iterator/this-val-non-obj-coercible.js [strict mode] (previously Failed)
test/built-ins/String/prototype/Symbol.iterator/this-val-non-obj-coercible.js (previously Failed)
test/built-ins/String/prototype/Symbol.iterator/this-val-to-str-err.js [strict mode] (previously Failed)
test/built-ins/String/prototype/Symbol.iterator/this-val-to-str-err.js (previously Failed)

@codecov
Copy link

codecov bot commented Apr 10, 2023

Codecov Report

Merging #2800 (1cdfc8d) into main (34d6b93) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2800      +/-   ##
==========================================
+ Coverage   50.57%   50.58%   +0.01%     
==========================================
  Files         415      415              
  Lines       41207    41209       +2     
==========================================
+ Hits        20841    20847       +6     
+ Misses      20366    20362       -4     
Impacted Files Coverage Δ
boa_engine/src/object/mod.rs 31.19% <ø> (ø)
boa_engine/src/builtins/string/mod.rs 63.46% <100.00%> (+0.08%) ⬆️
boa_engine/src/builtins/string/string_iterator.rs 100.00% <100.00%> (+9.30%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link

Benchmark for e377847

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 714.0±38.91ns 769.0±53.96ns +7.70%
Arithmetic operations (Execution) 545.9±23.42ns 556.2±40.74ns +1.89%
Arithmetic operations (Parser) 8.9±0.70µs 8.9±0.49µs 0.00%
Array access (Compiler) 2.1±0.10µs 2.3±0.14µs +9.52%
Array access (Execution) 9.5±0.40µs 9.6±0.40µs +1.05%
Array access (Parser) 18.4±0.99µs 17.5±0.89µs -4.89%
Array creation (Compiler) 3.2±0.21µs 3.6±0.24µs +12.50%
Array creation (Execution) 1266.3±49.81µs 1221.2±46.05µs -3.56%
Array creation (Parser) 23.1±1.06µs 22.6±1.30µs -2.16%
Array pop (Compiler) 5.3±0.40µs 5.8±0.34µs +9.43%
Array pop (Execution) 716.6±27.24µs 721.9±31.28µs +0.74%
Array pop (Parser) 200.0±6.75µs 205.3±9.64µs +2.65%
Boolean Object Access (Compiler) 1607.7±71.63ns 1603.8±84.47ns -0.24%
Boolean Object Access (Execution) 6.1±0.26µs 6.1±0.30µs 0.00%
Boolean Object Access (Parser) 22.5±1.32µs 21.8±0.91µs -3.11%
Clean js (Compiler) 6.4±0.43µs 7.2±1.04µs +12.50%
Clean js (Execution) 924.2±43.53µs 965.4±29.65µs +4.46%
Clean js (Parser) 47.6±2.20µs 45.3±2.13µs -4.83%
Create Realm 577.7±22.73µs 600.7±34.06µs +3.98%
Dynamic Object Property Access (Compiler) 2.6±0.09µs 2.8±0.12µs +7.69%
Dynamic Object Property Access (Execution) 6.2±0.33µs 6.4±0.28µs +3.23%
Dynamic Object Property Access (Parser) 16.9±1.50µs 16.5±0.71µs -2.37%
Fibonacci (Compiler) 3.9±0.18µs 4.2±0.15µs +7.69%
Fibonacci (Execution) 1344.4±55.44µs 1392.6±62.50µs +3.59%
Fibonacci (Parser) 27.4±1.37µs 26.2±1.48µs -4.38%
For loop (Compiler) 3.5±0.19µs 3.9±0.24µs +11.43%
For loop (Execution) 21.2±1.24µs 20.2±0.91µs -4.72%
For loop (Parser) 23.2±2.76µs 22.1±0.87µs -4.74%
Mini js (Compiler) 5.5±0.27µs 6.3±0.38µs +14.55%
Mini js (Execution) 867.9±41.78µs 865.4±37.82µs -0.29%
Mini js (Parser) 42.0±1.90µs 40.4±2.52µs -3.81%
Number Object Access (Compiler) 1413.9±65.15ns 1422.4±63.78ns +0.60%
Number Object Access (Execution) 4.7±0.20µs 4.6±0.25µs -2.13%
Number Object Access (Parser) 17.2±0.83µs 16.6±0.67µs -3.49%
Object Creation (Compiler) 2.4±0.12µs 2.5±0.20µs +4.17%
Object Creation (Execution) 5.9±0.23µs 6.2±0.31µs +5.08%
Object Creation (Parser) 14.5±0.70µs 14.2±0.80µs -2.07%
RegExp (Compiler) 2.6±0.13µs 2.8±0.18µs +7.69%
RegExp (Execution) 15.8±0.58µs 17.1±0.71µs +8.23%
RegExp (Parser) 15.9±0.74µs 15.7±0.86µs -1.26%
RegExp Creation (Compiler) 2.3±0.13µs 2.4±0.14µs +4.35%
RegExp Creation (Execution) 11.3±0.35µs 11.4±0.50µs +0.88%
RegExp Creation (Parser) 13.3±0.51µs 13.4±0.62µs +0.75%
RegExp Literal (Compiler) 2.5±0.15µs 2.8±0.09µs +12.00%
RegExp Literal (Execution) 15.7±0.72µs 16.4±0.91µs +4.46%
RegExp Literal (Parser) 18.5±0.95µs 17.5±0.62µs -5.41%
RegExp Literal Creation (Compiler) 2.3±0.10µs 2.4±0.09µs +4.35%
RegExp Literal Creation (Execution) 11.1±0.46µs 11.5±0.57µs +3.60%
RegExp Literal Creation (Parser) 14.8±0.64µs 15.1±0.70µs +2.03%
Static Object Property Access (Compiler) 2.3±0.09µs 2.4±0.11µs +4.35%
Static Object Property Access (Execution) 6.2±0.44µs 6.5±0.27µs +4.84%
Static Object Property Access (Parser) 15.9±0.87µs 15.2±0.90µs -4.40%
String Object Access (Compiler) 2.0±0.15µs 2.0±0.13µs 0.00%
String Object Access (Execution) 8.0±0.36µs 8.2±0.41µs +2.50%
String Object Access (Parser) 21.6±1.18µs 21.9±1.29µs +1.39%
String comparison (Compiler) 3.2±0.15µs 3.5±0.15µs +9.37%
String comparison (Execution) 5.4±0.25µs 5.3±0.32µs -1.85%
String comparison (Parser) 18.0±0.87µs 18.0±1.10µs 0.00%
String concatenation (Compiler) 2.6±0.13µs 2.8±0.09µs +7.69%
String concatenation (Execution) 4.9±0.24µs 4.9±0.22µs 0.00%
String concatenation (Parser) 12.4±1.86µs 12.5±0.54µs +0.81%
String copy (Compiler) 2.2±0.13µs 2.3±0.13µs +4.55%
String copy (Execution) 4.8±0.23µs 4.8±0.23µs 0.00%
String copy (Parser) 8.9±0.48µs 8.9±0.41µs 0.00%
Symbols (Compiler) 1614.3±53.86ns 1776.8±82.55ns +10.07%
Symbols (Execution) 4.8±0.21µs 4.9±0.27µs +2.08%
Symbols (Parser) 7.0±0.41µs 7.1±0.28µs +1.43%

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Nice change!

@raskad
Copy link
Member

raskad commented Apr 10, 2023

bors r+

bors bot pushed a commit that referenced this pull request Apr 10, 2023
It changes the following:
- Fixes`Symbol.prototype[@@iterator]` so it calls `RequireObjectCoercible` and then `ToString`
- Makes string iterator store a `JsString` which should be faster, instead of `JsValue` then calling `ToString` on every iteration
@bors
Copy link

bors bot commented Apr 10, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fix Symbol.prototype[@@iterator] [Merged by Bors] - Fix Symbol.prototype[@@iterator] Apr 10, 2023
@bors bors bot closed this Apr 10, 2023
@bors bors bot deleted the fix/string-prototype-symbol.iterator branch April 10, 2023 10:52
@HalidOdat HalidOdat changed the title [Merged by Bors] - Fix Symbol.prototype[@@iterator] [Merged by Bors] - Fix String.prototype[@@iterator] Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics run-benchmark Label used to run banchmarks on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants