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] - Using the new formatting arguments from Rust 1.58 #1834

Closed
wants to merge 2 commits into from

Conversation

Razican
Copy link
Member

@Razican Razican commented Feb 12, 2022

In Rust 1.58, capturing of bindings were added to format strings. This makes things more clear, so I added this where possible.

@Razican Razican added enhancement New feature or request Internal Category for changelog labels Feb 12, 2022
@Razican Razican added this to the v0.14.0 milestone Feb 12, 2022
@github-actions
Copy link

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 87,912 87,912 0
Passed 40,892 40,892 0
Ignored 19,929 19,929 0
Failed 27,091 27,091 0
Panics 0 0 0
Conformance 46.51% 46.51% 0.00%

@codecov
Copy link

codecov bot commented Feb 12, 2022

Codecov Report

Merging #1834 (2d55152) into main (7779c1a) will increase coverage by 0.03%.
The diff coverage is 49.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1834      +/-   ##
==========================================
+ Coverage   55.71%   55.75%   +0.03%     
==========================================
  Files         201      201              
  Lines       17326    17273      -53     
==========================================
- Hits         9654     9631      -23     
+ Misses       7672     7642      -30     
Impacted Files Coverage Δ
boa/src/builtins/string/mod.rs 63.94% <0.00%> (ø)
boa/src/object/operations.rs 62.19% <0.00%> (ø)
boa/src/syntax/ast/keyword.rs 84.21% <0.00%> (ø)
boa/src/syntax/ast/node/mod.rs 76.27% <0.00%> (ø)
boa/src/syntax/ast/node/yield/mod.rs 30.76% <0.00%> (ø)
boa/src/syntax/ast/position.rs 84.00% <ø> (ø)
boa/src/syntax/ast/punctuator.rs 44.44% <0.00%> (ø)
boa/src/syntax/lexer/cursor.rs 65.68% <0.00%> (ø)
boa/src/syntax/lexer/identifier.rs 62.50% <0.00%> (+0.96%) ⬆️
boa/src/syntax/lexer/mod.rs 64.95% <0.00%> (+1.09%) ⬆️
... and 26 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 7779c1a...2d55152. Read the comment docs.

@github-actions
Copy link

Benchmark for 6268410

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 389.4±0.59ns 394.8±0.51ns +1.39%
Arithmetic operations (Execution) 1968.5±2.12ns 2.0±0.01µs +1.60%
Arithmetic operations (Parser) 5.5±0.01µs 5.5±0.01µs 0.00%
Array access (Compiler) 832.0±2.39ns 803.5±1.04ns -3.43%
Array access (Execution) 10.3±0.06µs 10.5±0.11µs +1.94%
Array access (Parser) 11.9±0.02µs 11.9±0.02µs 0.00%
Array creation (Compiler) 1164.3±3.03ns 1179.5±3.01ns +1.31%
Array creation (Execution) 3.2±0.01ms 3.1±0.01ms -3.13%
Array creation (Parser) 13.2±0.01µs 13.3±0.03µs +0.76%
Array pop (Compiler) 3.0±0.01µs 2.8±0.00µs -6.67%
Array pop (Execution) 1358.1±4.32µs 1342.8±3.78µs -1.13%
Array pop (Parser) 136.5±0.07µs 134.9±0.07µs -1.17%
Boolean Object Access (Compiler) 685.4±1.27ns 686.8±1.83ns +0.20%
Boolean Object Access (Execution) 6.8±0.01µs 6.9±0.02µs +1.47%
Boolean Object Access (Parser) 13.9±0.01µs 14.0±0.02µs +0.72%
Clean js (Compiler) 2.2±0.00µs 2.1±0.00µs -4.55%
Clean js (Execution) 1472.0±8.31µs 1454.6±6.98µs -1.18%
Clean js (Parser) 28.4±0.04µs 28.2±0.03µs -0.70%
Create Realm 330.6±0.21ns 330.5±4.73ns -0.03%
Dynamic Object Property Access (Compiler) 1168.1±3.98ns 1158.7±3.15ns -0.80%
Dynamic Object Property Access (Execution) 6.8±0.04µs 6.8±0.04µs 0.00%
Dynamic Object Property Access (Parser) 10.6±0.01µs 10.6±0.03µs 0.00%
Fibonacci (Compiler) 1446.5±3.61ns 1444.2±3.11ns -0.16%
Fibonacci (Execution) 2.7±0.00ms 2.7±0.00ms 0.00%
Fibonacci (Parser) 15.9±0.01µs 15.9±0.03µs 0.00%
For loop (Compiler) 1268.1±3.68ns 1275.4±3.83ns +0.58%
For loop (Execution) 43.3±0.13µs 43.5±0.15µs +0.46%
For loop (Parser) 13.7±0.03µs 13.7±0.16µs 0.00%
Mini js (Compiler) 2.2±0.01µs 2.1±0.00µs -4.55%
Mini js (Execution) 1362.6±11.59µs 1353.2±7.43µs -0.69%
Mini js (Parser) 24.9±0.04µs 24.8±0.02µs -0.40%
Number Object Access (Compiler) 639.3±0.96ns 650.8±1.45ns +1.80%
Number Object Access (Execution) 5.3±0.02µs 5.4±0.03µs +1.89%
Number Object Access (Parser) 11.0±0.02µs 11.0±0.01µs 0.00%
Object Creation (Compiler) 959.7±9.95ns 951.5±1.27ns -0.85%
Object Creation (Execution) 6.2±0.03µs 6.1±0.02µs -1.61%
Object Creation (Parser) 9.2±0.02µs 9.3±0.06µs +1.09%
RegExp (Compiler) 1132.9±4.30ns 1138.5±2.13ns +0.49%
RegExp (Execution) 13.2±0.05µs 12.9±0.03µs -2.27%
RegExp (Parser) 10.1±0.01µs 10.1±0.02µs 0.00%
RegExp Creation (Compiler) 1020.9±3.28ns 1026.9±3.09ns +0.59%
RegExp Creation (Execution) 9.9±0.05µs 9.8±0.05µs -1.01%
RegExp Creation (Parser) 8.4±0.01µs 8.4±0.03µs 0.00%
RegExp Literal (Compiler) 1132.1±5.26ns 1145.2±3.78ns +1.16%
RegExp Literal (Execution) 13.1±0.03µs 13.0±0.03µs -0.76%
RegExp Literal (Parser) 8.1±0.01µs 8.1±0.01µs 0.00%
RegExp Literal Creation (Compiler) 1034.3±3.74ns 1023.3±2.93ns -1.06%
RegExp Literal Creation (Execution) 9.8±0.05µs 9.9±0.05µs +1.02%
RegExp Literal Creation (Parser) 6.3±0.01µs 6.4±0.04µs +1.59%
Static Object Property Access (Compiler) 985.5±3.44ns 979.3±4.31ns -0.63%
Static Object Property Access (Execution) 6.4±0.02µs 6.4±0.03µs 0.00%
Static Object Property Access (Parser) 9.9±0.02µs 9.9±0.03µs 0.00%
String Object Access (Compiler) 1019.2±3.73ns 1029.5±4.52ns +1.01%
String Object Access (Execution) 8.6±0.03µs 8.5±0.02µs -1.16%
String Object Access (Parser) 13.8±0.02µs 13.7±0.03µs -0.72%
String comparison (Compiler) 1296.9±2.69ns 1303.8±3.54ns +0.53%
String comparison (Execution) 7.1±0.03µs 7.1±0.02µs 0.00%
String comparison (Parser) 10.8±0.02µs 10.8±0.07µs 0.00%
String concatenation (Compiler) 1041.9±2.68ns 1041.9±3.92ns 0.00%
String concatenation (Execution) 6.1±0.02µs 6.1±0.01µs 0.00%
String concatenation (Parser) 7.5±0.01µs 7.4±0.04µs -1.33%
String copy (Compiler) 877.2±2.85ns 866.8±2.61ns -1.19%
String copy (Execution) 5.2±0.02µs 5.2±0.02µs 0.00%
String copy (Parser) 5.6±0.01µs 5.5±0.01µs -1.79%
Symbols (Compiler) 635.6±0.73ns 646.8±1.42ns +1.76%
Symbols (Execution) 4.9±0.01µs 4.9±0.02µs 0.00%
Symbols (Parser) 4.3±0.01µs 4.3±0.02µs 0.00%

@github-actions
Copy link

Benchmark for 9d58ca2

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 342.5±8.32ns 331.3±4.87ns -3.27%
Arithmetic operations (Execution) 1730.6±35.37ns 1687.6±26.95ns -2.48%
Arithmetic operations (Parser) 4.8±0.07µs 4.6±0.07µs -4.17%
Array access (Compiler) 723.6±12.83ns 694.4±11.08ns -4.04%
Array access (Execution) 9.1±0.14µs 8.9±0.11µs -2.20%
Array access (Parser) 10.8±0.03µs 10.2±0.18µs -5.56%
Array creation (Compiler) 1026.8±4.51ns 988.0±15.79ns -3.78%
Array creation (Execution) 2.8±0.04ms 2.6±0.03ms -7.14%
Array creation (Parser) 11.8±0.22µs 11.9±0.09µs +0.85%
Array pop (Compiler) 2.6±0.04µs 2.4±0.04µs -7.69%
Array pop (Execution) 1177.3±25.33µs 1361.1±4.57µs +15.61%
Array pop (Parser) 121.9±2.14µs 119.6±0.68µs -1.89%
Boolean Object Access (Compiler) 595.9±10.58ns 604.2±2.73ns +1.39%
Boolean Object Access (Execution) 7.0±0.01µs 6.5±0.02µs -7.14%
Boolean Object Access (Parser) 12.0±0.16µs 12.1±0.21µs +0.83%
Clean js (Compiler) 1914.2±6.66ns 1865.0±28.81ns -2.57%
Clean js (Execution) 1269.0±32.45µs 1275.3±25.13µs +0.50%
Clean js (Parser) 24.6±0.46µs 24.2±0.30µs -1.63%
Create Realm 291.9±6.42ns 339.6±2.30ns +16.34%
Dynamic Object Property Access (Compiler) 971.5±15.50ns 1009.4±14.36ns +3.90%
Dynamic Object Property Access (Execution) 5.8±0.10µs 5.8±0.09µs 0.00%
Dynamic Object Property Access (Parser) 9.2±0.19µs 9.2±0.09µs 0.00%
Fibonacci (Compiler) 1231.9±18.98ns 1267.3±23.11ns +2.87%
Fibonacci (Execution) 2.3±0.03ms 2.4±0.03ms +4.35%
Fibonacci (Parser) 14.0±0.19µs 13.9±0.17µs -0.71%
For loop (Compiler) 1091.0±14.42ns 1085.8±15.10ns -0.48%
For loop (Execution) 37.6±0.59µs 37.2±0.59µs -1.06%
For loop (Parser) 11.8±0.19µs 11.7±0.16µs -0.85%
Mini js (Compiler) 2.2±0.00µs 1838.7±29.69ns -16.42%
Mini js (Execution) 1171.5±25.79µs 1171.5±21.60µs 0.00%
Mini js (Parser) 21.5±0.29µs 21.3±0.29µs -0.93%
Number Object Access (Compiler) 561.9±8.31ns 571.2±5.16ns +1.66%
Number Object Access (Execution) 5.4±0.01µs 4.9±0.12µs -9.26%
Number Object Access (Parser) 9.5±0.16µs 9.4±0.14µs -1.05%
Object Creation (Compiler) 835.1±12.87ns 812.6±12.00ns -2.69%
Object Creation (Execution) 5.2±0.10µs 5.2±0.08µs 0.00%
Object Creation (Parser) 7.9±0.13µs 7.9±0.16µs 0.00%
RegExp (Compiler) 968.3±15.06ns 988.3±12.43ns +2.07%
RegExp (Execution) 11.5±0.13µs 11.2±0.18µs -2.61%
RegExp (Parser) 9.1±0.02µs 8.8±0.13µs -3.30%
RegExp Creation (Compiler) 881.9±12.68ns 875.3±14.86ns -0.75%
RegExp Creation (Execution) 8.6±0.17µs 8.4±0.14µs -2.33%
RegExp Creation (Parser) 7.6±0.02µs 7.4±0.11µs -2.63%
RegExp Literal (Compiler) 963.4±16.32ns 979.7±11.51ns +1.69%
RegExp Literal (Execution) 11.1±0.17µs 11.1±0.18µs 0.00%
RegExp Literal (Parser) 7.3±0.02µs 7.0±0.12µs -4.11%
RegExp Literal Creation (Compiler) 878.7±14.44ns 880.3±11.16ns +0.18%
RegExp Literal Creation (Execution) 8.4±0.13µs 8.3±0.12µs -1.19%
RegExp Literal Creation (Parser) 5.5±0.08µs 5.5±0.06µs 0.00%
Static Object Property Access (Compiler) 814.1±10.93ns 830.8±12.45ns +2.05%
Static Object Property Access (Execution) 5.4±0.10µs 5.4±0.11µs 0.00%
Static Object Property Access (Parser) 8.6±0.10µs 8.5±0.11µs -1.16%
String Object Access (Compiler) 919.0±4.68ns 917.2±41.52ns -0.20%
String Object Access (Execution) 8.8±0.05µs 7.7±0.18µs -12.50%
String Object Access (Parser) 12.0±0.22µs 11.7±0.17µs -2.50%
String comparison (Compiler) 1287.8±5.28ns 1115.9±25.14ns -13.35%
String comparison (Execution) 7.2±0.03µs 6.1±0.10µs -15.28%
String comparison (Parser) 10.8±0.02µs 9.1±0.12µs -15.74%
String concatenation (Compiler) 1039.6±2.98ns 883.0±12.02ns -15.06%
String concatenation (Execution) 5.5±0.01µs 5.1±0.07µs -7.27%
String concatenation (Parser) 6.4±0.08µs 6.5±0.13µs +1.56%
String copy (Compiler) 871.1±3.02ns 772.2±2.69ns -11.35%
String copy (Execution) 5.3±0.02µs 4.4±0.07µs -16.98%
String copy (Parser) 4.9±0.07µs 4.7±0.06µs -4.08%
Symbols (Compiler) 557.5±8.09ns 540.4±9.80ns -3.07%
Symbols (Execution) 4.2±0.05µs 4.2±0.05µs 0.00%
Symbols (Parser) 3.7±0.06µs 4.3±0.01µs +16.22%

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.

Looks good!

@RageKnify
Copy link
Member

bors r+

@RageKnify RageKnify removed the enhancement New feature or request label Feb 13, 2022
bors bot pushed a commit that referenced this pull request Feb 13, 2022
In [Rust 1.58](https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html#captured-identifiers-in-format-strings), capturing of bindings were added to format strings. This makes things more clear, so I added this where possible.
@bors
Copy link

bors bot commented Feb 13, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Using the new formatting arguments from Rust 1.58 [Merged by Bors] - Using the new formatting arguments from Rust 1.58 Feb 13, 2022
@bors bors bot closed this Feb 13, 2022
@bors bors bot deleted the format_bindings branch February 13, 2022 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Category for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants