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] - Integrate ICU4X into Intl module #2083

Closed
wants to merge 5 commits into from

Conversation

jedel1043
Copy link
Member

@jedel1043 jedel1043 commented May 22, 2022

This Pull Request integrates an ICU4X data provider API in our codebase, to make use of the internationalization APIs that this crate provides.

It changes the following:

  • Creates an API for pluggable icu data providers at Context creation, adding an Icu struct to store the provider (and some other internationalization tools) at runtime.
  • Slightly changes locale related functions to preserve the Locale type and ensure correctness. (Will make some other changes related to this).
  • Integrates the sys_locale crate to fetch the current default locale of an user instead of always returning en-US.

@jedel1043 jedel1043 added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics Internal Category for changelog labels May 22, 2022
@jedel1043 jedel1043 added this to the v0.15.0 milestone May 22, 2022
@jedel1043
Copy link
Member Author

jedel1043 commented May 22, 2022

Slightly related to #2068, since CLDR data increases our binary size significantly, and some users won't even use Intl

Edit: fixed by the intl feature gate

@github-actions
Copy link

github-actions bot commented May 22, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 90,265 90,265 0
Passed 54,889 54,909 +20
Ignored 23,351 23,351 0
Failed 12,025 12,005 -20
Panics 0 0 0
Conformance 60.81% 60.83% +0.02%
Fixed tests (22):
test/intl402/Intl/getCanonicalLocales/preferred-variant.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/preferred-variant.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/grandfathered.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/grandfathered.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/unicode-ext-canonicalize-region.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/unicode-ext-canonicalize-region.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/complex-region-subtag-replacement.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/complex-region-subtag-replacement.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/complex-language-subtag-replacement.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/complex-language-subtag-replacement.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/unicode-ext-key-with-digit.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/unicode-ext-key-with-digit.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/preferred-grandfathered.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/preferred-grandfathered.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/unicode-ext-canonicalize-subdivision.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/unicode-ext-canonicalize-subdivision.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/duplicates.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/duplicates.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/canonicalized-tags.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/canonicalized-tags.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/main.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/main.js (previously Failed)
Broken tests (2):
test/intl402/Intl/getCanonicalLocales/transformed-ext-valid.js [strict mode] (previously Passed)
test/intl402/Intl/getCanonicalLocales/transformed-ext-valid.js (previously Passed)

@github-actions
Copy link

Benchmark for e62ae17

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 701.9±62.69ns 693.3±52.34ns -1.23%
Arithmetic operations (Execution) 736.8±41.30ns 735.0±44.71ns -0.24%
Arithmetic operations (Parser) 7.4±0.49µs 7.2±0.63µs -2.70%
Array access (Compiler) 1985.4±74.27ns 1963.3±171.26ns -1.11%
Array access (Execution) 10.2±0.46µs 10.6±0.77µs +3.92%
Array access (Parser) 15.0±0.75µs 15.7±1.43µs +4.67%
Array creation (Compiler) 3.1±0.22µs 3.0±0.17µs -3.23%
Array creation (Execution) 3.0±0.16ms 2.9±0.12ms -3.33%
Array creation (Parser) 17.8±0.93µs 18.0±0.86µs +1.12%
Array pop (Compiler) 5.1±0.24µs 4.9±0.28µs -3.92%
Array pop (Execution) 1286.1±64.07µs 1289.1±55.09µs +0.23%
Array pop (Parser) 170.7±9.89µs 173.6±10.68µs +1.70%
Boolean Object Access (Compiler) 1413.0±77.11ns 1454.4±116.64ns +2.93%
Boolean Object Access (Execution) 5.7±0.50µs 5.6±0.30µs -1.75%
Boolean Object Access (Parser) 19.2±3.01µs 18.2±0.86µs -5.21%
Clean js (Compiler) 6.2±0.29µs 6.1±0.26µs -1.61%
Clean js (Execution) 830.1±41.28µs 830.8±37.45µs +0.08%
Clean js (Parser) 37.5±2.35µs 39.8±2.00µs +6.13%
Create Realm 326.3±16.88ns 324.7±26.67ns -0.49%
Dynamic Object Property Access (Compiler) 2.5±0.19µs 2.4±0.12µs -4.00%
Dynamic Object Property Access (Execution) 7.8±0.68µs 7.2±1.55µs -7.69%
Dynamic Object Property Access (Parser) 14.2±0.95µs 14.0±0.83µs -1.41%
Fibonacci (Compiler) 3.6±0.21µs 3.5±0.17µs -2.78%
Fibonacci (Execution) 1892.3±67.47µs 1854.3±112.20µs -2.01%
Fibonacci (Parser) 20.9±1.17µs 20.3±1.08µs -2.87%
For loop (Compiler) 3.4±0.18µs 3.5±0.16µs +2.94%
For loop (Execution) 21.0±2.13µs 20.2±1.13µs -3.81%
For loop (Parser) 18.2±1.21µs 17.9±1.42µs -1.65%
Mini js (Compiler) 5.3±0.27µs 5.3±0.39µs 0.00%
Mini js (Execution) 796.6±74.91µs 790.2±32.80µs -0.80%
Mini js (Parser) 33.4±2.21µs 35.0±2.01µs +4.79%
Number Object Access (Compiler) 1337.2±54.87ns 1362.2±82.84ns +1.87%
Number Object Access (Execution) 4.2±0.19µs 4.3±0.37µs +2.38%
Number Object Access (Parser) 14.1±0.70µs 14.5±0.82µs +2.84%
Object Creation (Compiler) 2.1±0.13µs 2.1±0.10µs 0.00%
Object Creation (Execution) 6.9±0.35µs 6.8±0.43µs -1.45%
Object Creation (Parser) 11.7±1.01µs 12.0±0.75µs +2.56%
RegExp (Compiler) 2.5±0.28µs 2.4±0.13µs -4.00%
RegExp (Execution) 15.1±1.00µs 14.8±0.82µs -1.99%
RegExp (Parser) 12.9±0.71µs 13.4±0.92µs +3.88%
RegExp Creation (Compiler) 2.1±0.12µs 2.1±0.14µs 0.00%
RegExp Creation (Execution) 11.5±0.54µs 11.0±0.64µs -4.35%
RegExp Creation (Parser) 11.3±0.65µs 11.1±0.58µs -1.77%
RegExp Literal (Compiler) 2.4±0.11µs 2.5±0.11µs +4.17%
RegExp Literal (Execution) 15.4±1.04µs 15.2±1.00µs -1.30%
RegExp Literal (Parser) 11.3±1.75µs 10.8±0.71µs -4.42%
RegExp Literal Creation (Compiler) 2.2±0.10µs 2.1±0.14µs -4.55%
RegExp Literal Creation (Execution) 11.6±0.62µs 11.3±0.73µs -2.59%
RegExp Literal Creation (Parser) 8.6±0.49µs 8.5±0.60µs -1.16%
Static Object Property Access (Compiler) 2.2±0.12µs 2.2±0.13µs 0.00%
Static Object Property Access (Execution) 7.1±0.37µs 7.2±1.16µs +1.41%
Static Object Property Access (Parser) 13.1±0.94µs 12.9±0.68µs -1.53%
String Object Access (Compiler) 1871.0±131.39ns 1835.6±235.87ns -1.89%
String Object Access (Execution) 8.2±0.43µs 8.6±0.53µs +4.88%
String Object Access (Parser) 18.4±1.13µs 17.8±1.40µs -3.26%
String comparison (Compiler) 3.0±0.23µs 3.0±0.19µs 0.00%
String comparison (Execution) 6.1±0.52µs 6.2±0.37µs +1.64%
String comparison (Parser) 14.0±0.70µs 13.8±0.75µs -1.43%
String concatenation (Compiler) 2.4±0.13µs 2.3±0.11µs -4.17%
String concatenation (Execution) 5.8±0.36µs 5.6±0.27µs -3.45%
String concatenation (Parser) 9.8±0.58µs 9.8±0.42µs 0.00%
String copy (Compiler) 2.0±0.16µs 2.1±0.10µs +5.00%
String copy (Execution) 5.7±0.48µs 5.6±0.24µs -1.75%
String copy (Parser) 7.2±0.41µs 7.4±0.53µs +2.78%
Symbols (Compiler) 1535.6±86.26ns 1588.0±184.06ns +3.41%
Symbols (Execution) 5.9±0.81µs 5.7±0.29µs -3.39%
Symbols (Parser) 5.7±0.33µs 5.5±0.68µs -3.51%

@jedel1043
Copy link
Member Author

Opened unicode-org/icu4x#1925 to fix the two failing tests.

@codecov
Copy link

codecov bot commented May 22, 2022

Codecov Report

Merging #2083 (4b60c63) into main (55060c6) will decrease coverage by 0.03%.
The diff coverage is 45.83%.

@@            Coverage Diff             @@
##             main    #2083      +/-   ##
==========================================
- Coverage   43.86%   43.82%   -0.04%     
==========================================
  Files         216      217       +1     
  Lines       19575    19559      -16     
==========================================
- Hits         8586     8572      -14     
+ Misses      10989    10987       -2     
Impacted Files Coverage Δ
boa_engine/src/builtins/map/map_iterator.rs 94.11% <ø> (ø)
boa_engine/src/builtins/map/mod.rs 84.04% <ø> (ø)
boa_engine/src/builtins/set/set_iterator.rs 80.00% <ø> (ø)
boa_engine/src/lib.rs 86.66% <ø> (-0.44%) ⬇️
boa_engine/src/object/jsproxy.rs 0.00% <ø> (ø)
boa_engine/src/object/mod.rs 20.10% <ø> (ø)
boa_engine/src/syntax/ast/keyword.rs 95.91% <ø> (ø)
boa_engine/src/syntax/lexer/regex.rs 53.52% <ø> (ø)
...t/declaration/hoistable/async_function_decl/mod.rs 28.00% <ø> (ø)
boa_engine/src/builtins/intl/mod.rs 60.95% <30.00%> (+0.81%) ⬆️
... and 16 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 55060c6...4b60c63. Read the comment docs.

@github-actions
Copy link

Benchmark for 92e463d

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 791.8±63.06ns 715.2±46.18ns -9.67%
Arithmetic operations (Execution) 774.4±56.20ns 760.0±57.88ns -1.86%
Arithmetic operations (Parser) 7.8±0.74µs 7.1±0.50µs -8.97%
Array access (Compiler) 1968.8±120.66ns 2.1±0.11µs +6.66%
Array access (Execution) 11.6±0.83µs 12.7±2.13µs +9.48%
Array access (Parser) 18.4±1.83µs 16.3±1.71µs -11.41%
Array creation (Compiler) 3.1±0.28µs 3.1±0.18µs 0.00%
Array creation (Execution) 3.2±0.14ms 3.5±0.27ms +9.38%
Array creation (Parser) 21.3±2.59µs 18.4±1.46µs -13.62%
Array pop (Compiler) 5.4±0.26µs 5.2±0.29µs -3.70%
Array pop (Execution) 1375.3±93.13µs 1470.4±85.13µs +6.91%
Array pop (Parser) 201.6±16.99µs 177.4±18.92µs -12.00%
Boolean Object Access (Compiler) 1567.2±91.93ns 1539.1±113.50ns -1.79%
Boolean Object Access (Execution) 5.7±0.36µs 5.5±0.37µs -3.51%
Boolean Object Access (Parser) 21.8±2.31µs 18.4±1.12µs -15.60%
Clean js (Compiler) 6.9±0.39µs 6.4±0.38µs -7.25%
Clean js (Execution) 872.9±60.12µs 868.0±80.46µs -0.56%
Clean js (Parser) 41.5±4.53µs 39.6±3.51µs -4.58%
Create Realm 346.3±26.85ns 356.5±27.49ns +2.95%
Dynamic Object Property Access (Compiler) 2.5±0.14µs 2.6±0.14µs +4.00%
Dynamic Object Property Access (Execution) 8.6±0.63µs 8.3±0.85µs -3.49%
Dynamic Object Property Access (Parser) 16.2±1.42µs 14.3±1.16µs -11.73%
Fibonacci (Compiler) 3.8±0.20µs 3.6±0.24µs -5.26%
Fibonacci (Execution) 2.1±0.12ms 1916.3±82.07µs -8.75%
Fibonacci (Parser) 22.2±1.51µs 22.1±1.37µs -0.45%
For loop (Compiler) 3.6±0.30µs 3.4±0.20µs -5.56%
For loop (Execution) 23.9±1.48µs 21.4±2.21µs -10.46%
For loop (Parser) 18.4±1.35µs 19.0±1.53µs +3.26%
Mini js (Compiler) 6.1±0.41µs 5.7±0.54µs -6.56%
Mini js (Execution) 819.9±47.56µs 814.0±43.65µs -0.72%
Mini js (Parser) 34.3±2.25µs 35.7±3.33µs +4.08%
Number Object Access (Compiler) 1563.3±104.54ns 1445.0±97.04ns -7.57%
Number Object Access (Execution) 4.3±0.23µs 4.3±0.23µs 0.00%
Number Object Access (Parser) 17.1±4.56µs 14.6±0.90µs -14.62%
Object Creation (Compiler) 2.3±0.20µs 2.3±0.16µs 0.00%
Object Creation (Execution) 8.1±0.63µs 6.9±0.44µs -14.81%
Object Creation (Parser) 13.5±0.83µs 12.1±0.71µs -10.37%
RegExp (Compiler) 2.5±0.18µs 2.5±0.25µs 0.00%
RegExp (Execution) 17.2±1.58µs 17.7±1.27µs +2.91%
RegExp (Parser) 15.3±1.43µs 13.7±1.16µs -10.46%
RegExp Creation (Compiler) 2.2±0.19µs 2.2±0.10µs 0.00%
RegExp Creation (Execution) 13.1±2.21µs 13.6±1.59µs +3.82%
RegExp Creation (Parser) 13.2±1.47µs 11.4±0.65µs -13.64%
RegExp Literal (Compiler) 2.6±0.17µs 2.5±0.14µs -3.85%
RegExp Literal (Execution) 17.4±1.09µs 17.6±1.08µs +1.15%
RegExp Literal (Parser) 12.3±1.56µs 10.9±0.68µs -11.38%
RegExp Literal Creation (Compiler) 2.2±0.21µs 2.2±0.11µs 0.00%
RegExp Literal Creation (Execution) 13.3±0.88µs 13.4±1.19µs +0.75%
RegExp Literal Creation (Parser) 9.6±0.88µs 8.3±0.47µs -13.54%
Static Object Property Access (Compiler) 2.3±0.18µs 2.2±0.13µs -4.35%
Static Object Property Access (Execution) 8.2±0.51µs 7.8±0.56µs -4.88%
Static Object Property Access (Parser) 14.5±0.83µs 13.4±0.94µs -7.59%
String Object Access (Compiler) 2.1±0.12µs 1959.0±130.63ns -6.71%
String Object Access (Execution) 8.6±0.58µs 8.3±0.62µs -3.49%
String Object Access (Parser) 19.2±1.37µs 19.1±1.30µs -0.52%
String comparison (Compiler) 3.1±0.18µs 3.0±0.16µs -3.23%
String comparison (Execution) 6.4±0.34µs 6.4±0.53µs 0.00%
String comparison (Parser) 16.4±1.54µs 14.1±0.80µs -14.02%
String concatenation (Compiler) 2.5±0.19µs 2.5±0.20µs 0.00%
String concatenation (Execution) 6.3±0.40µs 6.3±0.54µs 0.00%
String concatenation (Parser) 12.0±1.06µs 10.1±1.11µs -15.83%
String copy (Compiler) 2.4±0.31µs 2.2±0.28µs -8.33%
String copy (Execution) 5.9±0.46µs 5.6±0.26µs -5.08%
String copy (Parser) 8.2±0.66µs 7.3±0.46µs -10.98%
Symbols (Compiler) 1618.9±125.24ns 1660.3±253.66ns +2.56%
Symbols (Execution) 6.7±0.51µs 5.7±0.39µs -14.93%
Symbols (Parser) 5.8±0.48µs 6.1±0.36µs +5.17%

@jedel1043 jedel1043 requested review from HalidOdat, raskad and Razican and removed request for HalidOdat and raskad May 22, 2022 22:39
@raskad
Copy link
Member

raskad commented May 26, 2022

Do we really have to include the data in the executable? In addition to increasing binary sizes, this also is problematic for deterministic builds.

We call StaticDataProvider::new_from_static_blob at runtime right? For me it seems like not having to read and parse the data at runtime would be the only benefit to including it directly.

Can we not have an api for including the data? It would then most likely be a field on the Context I guess? We could then use this api ourselves in the relevant tests. That would also remove the need for a build.rs as we would only need the data for tests.

@jedel1043
Copy link
Member Author

jedel1043 commented May 26, 2022

Do we really have to include the data in the executable? In addition to increasing binary sizes, this also is problematic for deterministic builds.

Yeah, we do. The alternative would be to download the CLDR data at runtime, but that implies giving boa networking access at runtime.

Can we not have an api for including the data? It would then most likely be a field on the Context I guess? We could then use this api ourselves in the relevant tests. That would also remove the need for a build.rs as we would only need the data for tests

I think the biggest disadvantage of this would be that a user that wants to use the Intl object would need to learn the whole icu_data_provider api in order to even initialize the data, and if we do offer a fallback default data, then that's no different than having this PR but with a feature gate. (and I'm planning to do that asap)

If we want to preserve deterministic builds, and want the ability to include the data only on tests, a feature gate that also skips running the build.rs script is the simplest solution.

@raskad
Copy link
Member

raskad commented May 26, 2022

In addition to the feature flag, what do you think about hosting the icu4x_data.postcard file ourselves @jedel1043? Generating it in build.rs seems to increase the build times in our ci by a pretty large amount (in the test job on linux from ~8 minutes to ~14 minutes)

@jedel1043
Copy link
Member Author

jedel1043 commented May 26, 2022

By hosting you mean pushing the generated file to this repo? That would increase the size of this repo. Its current size is approximately 10 MB, and by additionally hosting the postcard file, we would increase its size to 43MB.

In addition to that, I'm thinking about the mainteinance costs of hosting the postcard. If we did that, everyone would need to remember to update the file when a new icu version releases (since postcards generated are not forwards compatible right now) or else the full build with the Intl object would break.

Also, I'm planning on replacing this current solution with an auto-generated module using the new crabbake feature, but the next release will be approximately in 3 months, so we won't need a postcard file at that point.

@raskad
Copy link
Member

raskad commented May 26, 2022

My idea would have been to generate the postcard files for every of our releases and push them to a separate branch or even have them in a separate git repository. That way we would sidestep the comparability and the size issue.

But apart from that we still would need a build.rs to download the files anyways. I think we should cut down on the new dependencies for that. Is there a need for const_format and eyre? Can't we just expect on every error in the build.rs?
Also I don't see the benefit of using cached_path. That crate pulls in too many dependencies that we are not using. The minimal set of dependencies would probably be this:

reqwest = { version = "0.11.10", default-features = false, features = ["rustls-tls"]}
tokio = { version = "1", features = ["full"] }
zip = { version = "0.6.2", default-features = false, features = ["deflate"] }

Imo the few lines of code that we save are not worth the ~50 additional dependencies.

@jedel1043
Copy link
Member Author

Yeah, I was also thinking using eyre, const_format and cached-path is a bit overkill for a script ran only once. We can also skip tokio by using ureq instead, reducing even more the number of dependencies

@jedel1043
Copy link
Member Author

jedel1043 commented May 27, 2022

OK, following @raskad suggestions and seeing v8 and spidermonkey made the same tradeoff about data providers, I completely removed the build.rs generated module and instead opted for a Context API to define data providers at runtime.

This is the most flexible option we currently can offer to our users, and generating the data is not that difficult with the icu_datagen crate.

I also took advantage of the icu_testdata crate to be able to offer a default provider in the meantime (and also to define a provider for us in tests), since I'd like to discuss on a better fitting default for users that only want to use Intl without doing any configuration :)

@github-actions
Copy link

Benchmark for 5121fca

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 645.8±28.06ns 667.7±36.25ns +3.39%
Arithmetic operations (Execution) 747.4±38.01ns 707.8±27.97ns -5.30%
Arithmetic operations (Parser) 6.7±0.23µs 6.8±0.37µs +1.49%
Array access (Compiler) 1970.1±121.74ns 1812.4±74.66ns -8.00%
Array access (Execution) 11.0±0.63µs 9.7±0.49µs -11.82%
Array access (Parser) 14.8±0.93µs 14.9±0.85µs +0.68%
Array creation (Compiler) 2.9±0.16µs 2.9±0.14µs 0.00%
Array creation (Execution) 3.0±0.15ms 2.8±0.17ms -6.67%
Array creation (Parser) 16.5±0.64µs 17.4±1.04µs +5.45%
Array pop (Compiler) 5.2±0.38µs 4.8±0.26µs -7.69%
Array pop (Execution) 1384.6±63.10µs 1253.2±56.90µs -9.49%
Array pop (Parser) 175.6±6.17µs 176.0±9.37µs +0.23%
Boolean Object Access (Compiler) 1426.6±56.72ns 1412.7±95.78ns -0.97%
Boolean Object Access (Execution) 5.4±0.24µs 5.1±0.25µs -5.56%
Boolean Object Access (Parser) 17.7±1.00µs 18.1±1.65µs +2.26%
Clean js (Compiler) 5.8±0.32µs 6.1±0.44µs +5.17%
Clean js (Execution) 866.5±45.91µs 811.6±56.75µs -6.34%
Clean js (Parser) 37.5±1.97µs 37.5±1.46µs 0.00%
Create Realm 254.2±17.27ns 280.0±14.08ns +10.15%
Dynamic Object Property Access (Compiler) 2.2±0.16µs 2.2±0.10µs 0.00%
Dynamic Object Property Access (Execution) 7.0±0.36µs 6.7±0.33µs -4.29%
Dynamic Object Property Access (Parser) 13.6±0.89µs 13.6±0.83µs 0.00%
Fibonacci (Compiler) 3.2±0.14µs 3.4±0.18µs +6.25%
Fibonacci (Execution) 1894.0±216.26µs 1714.7±94.10µs -9.47%
Fibonacci (Parser) 20.1±1.20µs 20.2±0.99µs +0.50%
For loop (Compiler) 3.1±0.24µs 3.2±0.21µs +3.23%
For loop (Execution) 20.0±1.18µs 20.2±1.44µs +1.00%
For loop (Parser) 17.2±0.71µs 19.1±0.99µs +11.05%
Mini js (Compiler) 5.0±0.21µs 5.0±0.25µs 0.00%
Mini js (Execution) 814.6±28.76µs 790.1±35.46µs -3.01%
Mini js (Parser) 32.4±1.54µs 33.1±1.73µs +2.16%
Number Object Access (Compiler) 1407.8±74.60ns 1328.2±68.35ns -5.65%
Number Object Access (Execution) 4.2±0.16µs 3.9±0.20µs -7.14%
Number Object Access (Parser) 13.5±0.50µs 13.7±0.83µs +1.48%
Object Creation (Compiler) 1991.9±152.95ns 1928.3±107.83ns -3.19%
Object Creation (Execution) 6.6±0.33µs 6.3±0.34µs -4.55%
Object Creation (Parser) 11.5±0.70µs 11.9±0.80µs +3.48%
RegExp (Compiler) 2.3±0.17µs 2.2±0.10µs -4.35%
RegExp (Execution) 15.9±1.21µs 14.3±0.71µs -10.06%
RegExp (Parser) 12.6±0.54µs 12.6±0.91µs 0.00%
RegExp Creation (Compiler) 2.1±0.18µs 1969.6±94.49ns -6.21%
RegExp Creation (Execution) 11.9±1.92µs 10.6±0.69µs -10.92%
RegExp Creation (Parser) 10.3±0.42µs 10.7±0.47µs +3.88%
RegExp Literal (Compiler) 2.4±0.16µs 2.2±0.09µs -8.33%
RegExp Literal (Execution) 15.6±0.96µs 14.5±1.18µs -7.05%
RegExp Literal (Parser) 10.0±0.52µs 10.5±0.83µs +5.00%
RegExp Literal Creation (Compiler) 2.1±0.16µs 1958.5±104.21ns -6.74%
RegExp Literal Creation (Execution) 11.4±0.81µs 10.6±0.85µs -7.02%
RegExp Literal Creation (Parser) 8.0±0.50µs 8.1±0.43µs +1.25%
Static Object Property Access (Compiler) 2.0±0.19µs 2.0±0.14µs 0.00%
Static Object Property Access (Execution) 6.7±0.42µs 6.3±0.27µs -5.97%
Static Object Property Access (Parser) 12.3±0.61µs 12.2±0.70µs -0.81%
String Object Access (Compiler) 1733.7±86.43ns 1697.7±74.47ns -2.08%
String Object Access (Execution) 8.1±0.31µs 7.3±0.25µs -9.88%
String Object Access (Parser) 17.2±0.86µs 17.2±0.94µs 0.00%
String comparison (Compiler) 2.9±0.11µs 2.8±0.14µs -3.45%
String comparison (Execution) 6.1±0.37µs 5.7±0.34µs -6.56%
String comparison (Parser) 13.2±0.66µs 13.6±0.59µs +3.03%
String concatenation (Compiler) 2.2±0.12µs 2.2±0.17µs 0.00%
String concatenation (Execution) 5.9±0.33µs 5.4±0.34µs -8.47%
String concatenation (Parser) 9.4±0.49µs 9.5±0.56µs +1.06%
String copy (Compiler) 1872.9±75.15ns 1840.2±127.61ns -1.75%
String copy (Execution) 5.5±0.32µs 5.1±0.24µs -7.27%
String copy (Parser) 6.9±0.27µs 7.1±0.37µs +2.90%
Symbols (Compiler) 1336.7±57.28ns 1418.1±79.92ns +6.09%
Symbols (Execution) 5.4±0.30µs 5.4±0.28µs 0.00%
Symbols (Parser) 5.4±0.29µs 5.8±0.70µs +7.41%

@github-actions
Copy link

Benchmark for a78fb74

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 519.6±1.84ns 527.2±1.64ns +1.46%
Arithmetic operations (Execution) 503.6±0.58ns 504.8±0.60ns +0.24%
Arithmetic operations (Parser) 6.1±0.07µs 5.9±0.01µs -3.28%
Array access (Compiler) 1508.0±2.56ns 1617.0±20.18ns +7.23%
Array access (Execution) 8.9±0.04µs 8.7±0.03µs -2.25%
Array access (Parser) 14.0±0.05µs 13.9±0.05µs -0.71%
Array creation (Compiler) 2.4±0.01µs 2.4±0.01µs 0.00%
Array creation (Execution) 2.4±0.00ms 2.5±0.02ms +4.17%
Array creation (Parser) 16.4±0.04µs 15.9±0.03µs -3.05%
Array pop (Compiler) 4.2±0.01µs 4.1±0.01µs -2.38%
Array pop (Execution) 1147.4±6.33µs 1149.9±6.08µs +0.22%
Array pop (Parser) 155.1±0.56µs 155.5±0.24µs +0.26%
Boolean Object Access (Compiler) 1172.9±6.19ns 1183.3±2.92ns +0.89%
Boolean Object Access (Execution) 4.5±0.01µs 4.4±0.01µs -2.22%
Boolean Object Access (Parser) 16.8±0.02µs 16.7±0.03µs -0.60%
Clean js (Compiler) 5.0±0.02µs 5.1±0.01µs +2.00%
Clean js (Execution) 748.5±4.73µs 745.6±8.35µs -0.39%
Clean js (Parser) 35.6±0.05µs 35.2±0.07µs -1.12%
Create Realm 228.0±0.20ns 232.8±0.27ns +2.11%
Dynamic Object Property Access (Compiler) 1893.2±10.94ns 1856.1±29.65ns -1.96%
Dynamic Object Property Access (Execution) 5.6±0.02µs 5.4±0.01µs -3.57%
Dynamic Object Property Access (Parser) 12.7±0.03µs 12.7±0.04µs 0.00%
Fibonacci (Compiler) 2.9±0.01µs 2.8±0.01µs -3.45%
Fibonacci (Execution) 1439.6±3.22µs 1399.4±6.85µs -2.79%
Fibonacci (Parser) 19.5±0.10µs 18.7±0.08µs -4.10%
For loop (Compiler) 2.7±0.01µs 2.7±0.01µs 0.00%
For loop (Execution) 16.2±0.04µs 16.3±0.03µs +0.62%
For loop (Parser) 16.8±0.06µs 16.3±0.08µs -2.98%
Mini js (Compiler) 4.4±0.01µs 4.4±0.01µs 0.00%
Mini js (Execution) 698.6±5.62µs 699.4±4.94µs +0.11%
Mini js (Parser) 31.0±0.05µs 30.3±0.09µs -2.26%
Number Object Access (Compiler) 1111.5±3.07ns 1110.4±4.27ns -0.10%
Number Object Access (Execution) 3.5±0.01µs 3.5±0.01µs 0.00%
Number Object Access (Parser) 13.3±0.02µs 12.9±0.04µs -3.01%
Object Creation (Compiler) 1638.2±4.61ns 1673.9±6.31ns +2.18%
Object Creation (Execution) 5.3±0.02µs 5.0±0.01µs -5.66%
Object Creation (Parser) 11.1±0.02µs 11.0±0.10µs -0.90%
RegExp (Compiler) 1891.5±6.08ns 1902.6±8.78ns +0.59%
RegExp (Execution) 12.7±0.07µs 12.3±0.09µs -3.15%
RegExp (Parser) 12.2±0.03µs 11.9±0.07µs -2.46%
RegExp Creation (Compiler) 1677.7±5.44ns 1683.4±4.38ns +0.34%
RegExp Creation (Execution) 9.5±0.04µs 9.3±0.05µs -2.11%
RegExp Creation (Parser) 10.2±0.07µs 9.9±0.06µs -2.94%
RegExp Literal (Compiler) 1859.5±6.70ns 1880.8±14.86ns +1.15%
RegExp Literal (Execution) 12.6±0.10µs 12.3±0.07µs -2.38%
RegExp Literal (Parser) 9.8±0.05µs 9.7±0.03µs -1.02%
RegExp Literal Creation (Compiler) 1687.4±4.11ns 1658.3±4.11ns -1.72%
RegExp Literal Creation (Execution) 9.5±0.04µs 9.3±0.05µs -2.11%
RegExp Literal Creation (Parser) 7.7±0.03µs 7.6±0.06µs -1.30%
Static Object Property Access (Compiler) 1637.2±3.86ns 1678.3±13.59ns +2.51%
Static Object Property Access (Execution) 5.4±0.04µs 5.2±0.02µs -3.70%
Static Object Property Access (Parser) 11.9±0.04µs 11.6±0.02µs -2.52%
String Object Access (Compiler) 1497.8±2.54ns 1502.0±6.39ns +0.28%
String Object Access (Execution) 6.5±0.05µs 6.4±0.04µs -1.54%
String Object Access (Parser) 16.7±0.02µs 16.3±0.04µs -2.40%
String comparison (Compiler) 2.4±0.01µs 2.5±0.02µs +4.17%
String comparison (Execution) 4.7±0.02µs 4.7±0.03µs 0.00%
String comparison (Parser) 13.1±0.06µs 12.9±0.05µs -1.53%
String concatenation (Compiler) 1822.2±7.36ns 1789.5±4.17ns -1.79%
String concatenation (Execution) 4.6±0.01µs 4.5±0.02µs -2.17%
String concatenation (Parser) 9.2±0.03µs 9.0±0.04µs -2.17%
String copy (Compiler) 1485.7±2.70ns 1469.1±3.55ns -1.12%
String copy (Execution) 4.2±0.02µs 4.1±0.02µs -2.38%
String copy (Parser) 7.0±0.03µs 6.8±0.07µs -2.86%
Symbols (Compiler) 1110.7±4.40ns 1106.5±2.70ns -0.38%
Symbols (Execution) 4.4±0.01µs 4.4±0.02µs 0.00%
Symbols (Parser) 5.4±0.04µs 5.2±0.03µs -3.70%

@github-actions
Copy link

Benchmark for 235a5cc

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 472.9±1.12ns 474.1±0.99ns +0.25%
Arithmetic operations (Execution) 674.6±0.71ns 580.4±0.80ns -13.96%
Arithmetic operations (Parser) 5.8±0.01µs 5.9±0.02µs +1.72%
Array access (Compiler) 1273.1±3.05ns 1420.9±3.02ns +11.61%
Array access (Execution) 7.2±0.02µs 7.1±0.02µs -1.39%
Array access (Parser) 11.7±0.03µs 13.1±0.03µs +11.97%
Array creation (Compiler) 2.2±0.01µs 2.2±0.01µs 0.00%
Array creation (Execution) 2.2±0.00ms 2.2±0.01ms 0.00%
Array creation (Parser) 13.6±0.03µs 15.2±0.06µs +11.76%
Array pop (Compiler) 4.1±0.01µs 4.1±0.01µs 0.00%
Array pop (Execution) 1142.8±3.08µs 1001.5±3.35µs -12.36%
Array pop (Parser) 129.4±0.20µs 146.3±0.20µs +13.06%
Boolean Object Access (Compiler) 1004.6±2.49ns 1004.7±2.45ns +0.01%
Boolean Object Access (Execution) 4.2±0.01µs 4.2±0.01µs 0.00%
Boolean Object Access (Parser) 15.8±0.02µs 16.0±0.03µs +1.27%
Clean js (Compiler) 4.6±0.03µs 4.6±0.01µs 0.00%
Clean js (Execution) 622.2±3.29µs 619.6±4.19µs -0.42%
Clean js (Parser) 33.3±0.39µs 33.1±0.03µs -0.60%
Create Realm 199.8±2.51ns 232.7±0.20ns +16.47%
Dynamic Object Property Access (Compiler) 1492.8±2.91ns 1688.0±3.74ns +13.08%
Dynamic Object Property Access (Execution) 4.8±0.01µs 4.7±0.02µs -2.08%
Dynamic Object Property Access (Parser) 10.5±0.02µs 11.8±0.03µs +12.38%
Fibonacci (Compiler) 2.3±0.01µs 2.6±0.02µs +13.04%
Fibonacci (Execution) 1319.8±3.10µs 1141.7±5.76µs -13.49%
Fibonacci (Parser) 15.9±0.03µs 17.8±0.02µs +11.95%
For loop (Compiler) 2.2±0.01µs 2.4±0.00µs +9.09%
For loop (Execution) 15.9±0.03µs 14.0±0.05µs -11.95%
For loop (Parser) 13.8±0.05µs 15.6±0.03µs +13.04%
Mini js (Compiler) 3.6±0.01µs 3.6±0.01µs 0.00%
Mini js (Execution) 586.6±9.01µs 669.2±3.36µs +14.08%
Mini js (Parser) 25.5±0.03µs 28.8±0.28µs +12.94%
Number Object Access (Compiler) 961.8±4.97ns 944.1±3.46ns -1.84%
Number Object Access (Execution) 2.9±0.00µs 2.8±0.01µs -3.45%
Number Object Access (Parser) 10.9±0.03µs 12.3±0.06µs +12.84%
Object Creation (Compiler) 1466.0±7.53ns 1468.8±6.84ns +0.19%
Object Creation (Execution) 4.5±0.01µs 4.3±0.01µs -4.44%
Object Creation (Parser) 9.1±0.02µs 10.3±0.03µs +13.19%
RegExp (Compiler) 1487.6±3.23ns 1674.1±3.19ns +12.54%
RegExp (Execution) 10.4±0.06µs 10.1±0.03µs -2.88%
RegExp (Parser) 11.5±0.02µs 11.3±0.07µs -1.74%
RegExp Creation (Compiler) 1517.4±5.02ns 1490.9±3.30ns -1.75%
RegExp Creation (Execution) 7.7±0.02µs 8.7±0.03µs +12.99%
RegExp Creation (Parser) 8.5±0.03µs 9.5±0.03µs +11.76%
RegExp Literal (Compiler) 1487.2±2.68ns 1691.1±3.96ns +13.71%
RegExp Literal (Execution) 10.3±0.04µs 10.1±0.03µs -1.94%
RegExp Literal (Parser) 9.2±0.01µs 9.2±0.02µs 0.00%
RegExp Literal Creation (Compiler) 1330.2±3.15ns 1515.3±4.69ns +13.92%
RegExp Literal Creation (Execution) 7.7±0.02µs 7.6±0.02µs -1.30%
RegExp Literal Creation (Parser) 7.2±0.02µs 7.2±0.03µs 0.00%
Static Object Property Access (Compiler) 1338.7±4.34ns 1514.5±7.24ns +13.13%
Static Object Property Access (Execution) 4.6±0.05µs 4.5±0.01µs -2.17%
Static Object Property Access (Parser) 11.1±0.02µs 11.0±0.02µs -0.90%
String Object Access (Compiler) 1251.3±4.29ns 1244.7±3.54ns -0.53%
String Object Access (Execution) 5.3±0.02µs 6.0±0.02µs +13.21%
String Object Access (Parser) 15.5±0.14µs 15.5±0.14µs 0.00%
String comparison (Compiler) 1935.3±15.37ns 2.2±0.01µs +13.68%
String comparison (Execution) 4.0±0.01µs 4.0±0.01µs 0.00%
String comparison (Parser) 10.8±0.03µs 12.0±0.01µs +11.11%
String concatenation (Compiler) 1503.7±2.56ns 1697.7±2.98ns +12.90%
String concatenation (Execution) 3.8±0.02µs 3.8±0.02µs 0.00%
String concatenation (Parser) 7.5±0.03µs 8.4±0.01µs +12.00%
String copy (Compiler) 1230.6±3.14ns 1367.8±4.77ns +11.15%
String copy (Execution) 3.6±0.01µs 3.6±0.01µs 0.00%
String copy (Parser) 5.7±0.02µs 6.3±0.01µs +10.53%
Symbols (Compiler) 1045.1±2.47ns 1046.7±2.43ns +0.15%
Symbols (Execution) 3.7±0.00µs 3.6±0.01µs -2.70%
Symbols (Parser) 5.1±0.01µs 5.0±0.01µs -1.96%

@github-actions
Copy link

Benchmark for a9f220e

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 537.0±0.94ns 536.5±1.80ns -0.09%
Arithmetic operations (Execution) 656.6±0.38ns 658.3±0.45ns +0.26%
Arithmetic operations (Parser) 5.8±0.01µs 5.8±0.01µs 0.00%
Array access (Compiler) 1425.9±3.39ns 1423.3±3.38ns -0.18%
Array access (Execution) 8.1±0.02µs 8.0±0.03µs -1.23%
Array access (Parser) 13.0±0.03µs 13.1±0.02µs +0.77%
Array creation (Compiler) 2.2±0.01µs 1919.1±5.33ns -12.77%
Array creation (Execution) 2.5±0.00ms 2.5±0.01ms 0.00%
Array creation (Parser) 13.4±0.02µs 15.2±0.02µs +13.43%
Array pop (Compiler) 4.1±0.01µs 4.1±0.01µs 0.00%
Array pop (Execution) 3.4±0.01ms 1132.0±3.99µs -66.71%
Array pop (Parser) 136.8±8.54µs 146.5±0.31µs +7.09%
Boolean Object Access (Compiler) 1145.0±5.92ns 993.8±2.90ns -13.21%
Boolean Object Access (Execution) 3.7±0.01µs 12.6±0.09µs +240.54%
Boolean Object Access (Parser) 15.8±0.02µs 15.9±0.02µs +0.63%
Clean js (Compiler) 4.6±0.01µs 4.7±0.02µs +2.17%
Clean js (Execution) 699.1±3.33µs 699.8±4.58µs +0.10%
Clean js (Parser) 33.2±0.03µs 33.0±0.05µs -0.60%
Create Realm 226.3±1.92ns 234.2±0.35ns +3.49%
Dynamic Object Property Access (Compiler) 1690.5±3.68ns 1698.3±2.61ns +0.46%
Dynamic Object Property Access (Execution) 5.4±0.01µs 5.4±0.02µs 0.00%
Dynamic Object Property Access (Parser) 10.4±0.02µs 11.8±0.02µs +13.46%
Fibonacci (Compiler) 2.7±0.01µs 2.6±0.01µs -3.70%
Fibonacci (Execution) 1175.3±3.35µs 1288.7±6.50µs +9.65%
Fibonacci (Parser) 17.9±0.04µs 17.6±0.02µs -1.68%
For loop (Compiler) 2.2±0.01µs 2.4±0.00µs +9.09%
For loop (Execution) 15.9±0.03µs 15.8±0.03µs -0.63%
For loop (Parser) 13.7±0.03µs 15.6±0.46µs +13.87%
Mini js (Compiler) 3.6±0.01µs 4.1±0.02µs +13.89%
Mini js (Execution) 657.7±4.89µs 659.7±3.91µs +0.30%
Mini js (Parser) 28.8±0.05µs 28.9±0.05µs +0.35%
Number Object Access (Compiler) 1080.1±1.88ns 940.8±2.01ns -12.90%
Number Object Access (Execution) 3.2±0.01µs 2.8±0.00µs -12.50%
Number Object Access (Parser) 12.3±0.03µs 12.3±0.03µs 0.00%
Object Creation (Compiler) 1461.9±3.17ns 1452.4±2.60ns -0.65%
Object Creation (Execution) 5.0±0.01µs 4.4±0.01µs -12.00%
Object Creation (Parser) 10.3±0.01µs 10.3±0.02µs 0.00%
RegExp (Compiler) 1688.9±3.53ns 1656.0±9.66ns -1.95%
RegExp (Execution) 10.3±0.04µs 11.6±0.07µs +12.62%
RegExp (Parser) 11.3±0.02µs 11.3±0.02µs 0.00%
RegExp Creation (Compiler) 1508.9±4.51ns 1323.1±2.24ns -12.31%
RegExp Creation (Execution) 8.8±0.04µs 8.8±0.04µs 0.00%
RegExp Creation (Parser) 9.5±0.02µs 9.4±0.01µs -1.05%
RegExp Literal (Compiler) 1676.4±3.59ns 1477.7±2.39ns -11.85%
RegExp Literal (Execution) 10.4±0.04µs 11.5±0.06µs +10.58%
RegExp Literal (Parser) 9.0±0.02µs 9.3±0.02µs +3.33%
RegExp Literal Creation (Compiler) 1500.6±8.85ns 1506.5±3.07ns +0.39%
RegExp Literal Creation (Execution) 8.8±0.04µs 8.8±0.03µs 0.00%
RegExp Literal Creation (Parser) 7.0±0.03µs 7.1±0.03µs +1.43%
Static Object Property Access (Compiler) 1488.0±2.73ns 1494.2±3.79ns +0.42%
Static Object Property Access (Execution) 5.2±0.02µs 5.1±0.02µs -1.92%
Static Object Property Access (Parser) 11.0±0.01µs 9.7±0.02µs -11.82%
String Object Access (Compiler) 1409.8±3.46ns 1242.0±3.08ns -11.90%
String Object Access (Execution) 6.0±0.02µs 5.9±0.02µs -1.67%
String Object Access (Parser) 15.5±0.01µs 13.7±0.01µs -11.61%
String comparison (Compiler) 2.2±0.01µs 2.2±0.01µs 0.00%
String comparison (Execution) 4.5±0.01µs 4.5±0.01µs 0.00%
String comparison (Parser) 12.1±0.04µs 12.1±0.02µs 0.00%
String concatenation (Compiler) 1673.1±3.28ns 1701.0±3.38ns +1.67%
String concatenation (Execution) 4.3±0.01µs 4.3±0.01µs 0.00%
String concatenation (Parser) 8.4±0.02µs 8.4±0.04µs 0.00%
String copy (Compiler) 1393.5±3.76ns 1392.2±3.18ns -0.09%
String copy (Execution) 4.1±0.01µs 4.0±0.02µs -2.44%
String copy (Parser) 6.4±0.02µs 6.4±0.02µs 0.00%
Symbols (Compiler) 932.3±1.70ns 1037.1±4.04ns +11.24%
Symbols (Execution) 4.2±0.01µs 4.1±0.02µs -2.38%
Symbols (Parser) 4.4±0.02µs 5.0±0.01µs +13.64%

Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

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

This approach looks really good to me. I would be happy to merge this. Two follow ups I see are:

  • creation of an example on how to include the icu data (can probably wait until we have a good amount of Intl tests passing so that the feature can be used)
  • Usage of icu data in our tests

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 good to me :) check my comments to see if they make sense, and we can then merge!

boa_engine/Cargo.toml Show resolved Hide resolved
boa_engine/src/builtins/intl/mod.rs Outdated Show resolved Hide resolved
@jedel1043 jedel1043 requested a review from Razican May 29, 2022 09:26
@github-actions
Copy link

Benchmark for b020856

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 697.2±21.36ns 671.8±17.97ns -3.64%
Arithmetic operations (Execution) 737.5±51.99ns 724.5±28.84ns -1.76%
Arithmetic operations (Parser) 7.4±0.26µs 6.9±0.19µs -6.76%
Array access (Compiler) 1897.8±72.31ns 1990.1±100.56ns +4.86%
Array access (Execution) 10.7±0.63µs 10.2±0.42µs -4.67%
Array access (Parser) 15.7±0.54µs 15.5±0.43µs -1.27%
Array creation (Compiler) 2.9±0.11µs 2.9±0.08µs 0.00%
Array creation (Execution) 2.9±0.10ms 2.9±0.10ms 0.00%
Array creation (Parser) 18.1±0.75µs 18.1±2.11µs 0.00%
Array pop (Compiler) 5.1±0.12µs 4.9±0.17µs -3.92%
Array pop (Execution) 1299.4±32.05µs 1295.7±53.42µs -0.28%
Array pop (Parser) 174.1±6.17µs 197.9±13.78µs +13.67%
Boolean Object Access (Compiler) 1437.5±38.94ns 1456.1±137.37ns +1.29%
Boolean Object Access (Execution) 5.3±0.15µs 5.3±0.19µs 0.00%
Boolean Object Access (Parser) 18.2±0.62µs 18.0±0.93µs -1.10%
Clean js (Compiler) 6.2±0.19µs 5.9±0.29µs -4.84%
Clean js (Execution) 850.1±45.90µs 827.8±28.44µs -2.62%
Clean js (Parser) 39.4±1.27µs 38.2±1.32µs -3.05%
Create Realm 275.8±8.55ns 277.9±11.04ns +0.76%
Dynamic Object Property Access (Compiler) 2.3±0.10µs 2.3±0.10µs 0.00%
Dynamic Object Property Access (Execution) 7.4±0.33µs 7.0±0.33µs -5.41%
Dynamic Object Property Access (Parser) 14.7±0.60µs 13.8±0.62µs -6.12%
Fibonacci (Compiler) 3.5±0.24µs 3.5±0.13µs 0.00%
Fibonacci (Execution) 1784.4±96.84µs 1710.4±52.62µs -4.15%
Fibonacci (Parser) 22.0±0.56µs 20.6±1.14µs -6.36%
For loop (Compiler) 3.2±0.25µs 3.3±0.16µs +3.12%
For loop (Execution) 20.7±0.71µs 19.7±0.91µs -4.83%
For loop (Parser) 18.9±0.69µs 18.2±0.86µs -3.70%
Mini js (Compiler) 5.4±0.17µs 5.3±0.16µs -1.85%
Mini js (Execution) 769.9±22.53µs 764.3±29.74µs -0.73%
Mini js (Parser) 34.1±1.09µs 33.9±2.62µs -0.59%
Number Object Access (Compiler) 1374.9±93.11ns 1345.8±69.34ns -2.12%
Number Object Access (Execution) 4.1±0.14µs 4.0±0.13µs -2.44%
Number Object Access (Parser) 14.6±0.74µs 14.4±0.68µs -1.37%
Object Creation (Compiler) 1964.9±94.00ns 2.1±0.19µs +6.88%
Object Creation (Execution) 6.9±0.26µs 6.6±0.28µs -4.35%
Object Creation (Parser) 13.0±0.77µs 12.1±0.58µs -6.92%
RegExp (Compiler) 2.2±0.08µs 2.3±0.10µs +4.55%
RegExp (Execution) 16.2±1.74µs 15.1±0.52µs -6.79%
RegExp (Parser) 13.8±0.74µs 13.3±0.46µs -3.62%
RegExp Creation (Compiler) 2.0±0.09µs 2.1±0.07µs +5.00%
RegExp Creation (Execution) 11.3±0.60µs 11.4±0.51µs +0.88%
RegExp Creation (Parser) 11.4±0.40µs 11.0±0.41µs -3.51%
RegExp Literal (Compiler) 2.2±0.07µs 2.2±0.08µs 0.00%
RegExp Literal (Execution) 15.2±0.60µs 15.0±0.57µs -1.32%
RegExp Literal (Parser) 11.0±0.34µs 10.6±0.44µs -3.64%
RegExp Literal Creation (Compiler) 2.0±0.07µs 1966.7±60.85ns -1.66%
RegExp Literal Creation (Execution) 11.3±0.51µs 11.6±0.66µs +2.65%
RegExp Literal Creation (Parser) 8.6±0.30µs 8.4±0.33µs -2.33%
Static Object Property Access (Compiler) 1986.3±82.52ns 2.2±0.17µs +10.76%
Static Object Property Access (Execution) 7.1±0.23µs 7.0±0.53µs -1.41%
Static Object Property Access (Parser) 13.2±0.35µs 12.9±0.95µs -2.27%
String Object Access (Compiler) 1812.5±43.35ns 1788.9±90.72ns -1.30%
String Object Access (Execution) 7.8±0.41µs 7.7±0.22µs -1.28%
String Object Access (Parser) 18.3±0.73µs 17.6±0.71µs -3.83%
String comparison (Compiler) 2.9±0.18µs 2.8±0.10µs -3.45%
String comparison (Execution) 6.3±0.35µs 5.9±0.31µs -6.35%
String comparison (Parser) 14.5±0.61µs 14.3±0.59µs -1.38%
String concatenation (Compiler) 2.3±0.10µs 2.2±0.07µs -4.35%
String concatenation (Execution) 5.7±0.21µs 5.6±0.31µs -1.75%
String concatenation (Parser) 10.2±0.41µs 9.9±0.47µs -2.94%
String copy (Compiler) 1893.7±74.32ns 1851.2±57.35ns -2.24%
String copy (Execution) 5.4±0.21µs 5.2±0.20µs -3.70%
String copy (Parser) 7.5±0.24µs 7.3±0.30µs -2.67%
Symbols (Compiler) 1431.3±53.94ns 1456.9±73.84ns +1.79%
Symbols (Execution) 5.6±0.21µs 5.3±0.27µs -5.36%
Symbols (Parser) 6.0±0.20µs 5.6±0.22µs -6.67%

@jedel1043
Copy link
Member Author

@Razican Sorry! I addressed your comments and requested a review but I didn't see that you'd already approved the PR 😅

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.

All good! let's merge :)

@Razican
Copy link
Member

Razican commented May 30, 2022

bors r+

bors bot pushed a commit that referenced this pull request May 30, 2022
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->

This Pull Request integrates an `ICU4X` data provider API in our codebase, to make use of the internationalization APIs that this crate provides.

It changes the following:

- Creates an API for pluggable icu data providers at `Context` creation, adding an `Icu` struct to store the provider (and some other internationalization tools) at runtime.
- Slightly changes locale related functions to preserve the `Locale` type and ensure correctness. (Will make some other changes related to this).
- Integrates the `sys_locale` crate to fetch the current default locale of an user instead of always returning `en-US`.
@bors
Copy link

bors bot commented May 30, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Integrate ICU4X into Intl module [Merged by Bors] - Integrate ICU4X into Intl module May 30, 2022
@bors bors bot closed this May 30, 2022
@bors bors bot deleted the icu4x-integration branch May 30, 2022 12:38
Razican added a commit that referenced this pull request Jun 8, 2022
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->

This Pull Request integrates an `ICU4X` data provider API in our codebase, to make use of the internationalization APIs that this crate provides.

It changes the following:

- Creates an API for pluggable icu data providers at `Context` creation, adding an `Icu` struct to store the provider (and some other internationalization tools) at runtime.
- Slightly changes locale related functions to preserve the `Locale` type and ensure correctness. (Will make some other changes related to this).
- Integrates the `sys_locale` crate to fetch the current default locale of an user instead of always returning `en-US`.
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 enhancement New feature or request Internal Category for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants