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

perf(es/parser): Use faster unicode crate #8785

Merged
merged 7 commits into from
Apr 1, 2024
Merged

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Mar 27, 2024

Description:

cc @Boshen

Related issue (if exists):

@kdy1 kdy1 added this to the Planned milestone Mar 27, 2024
@kdy1 kdy1 self-assigned this Mar 27, 2024
Copy link

changeset-bot bot commented Mar 27, 2024

⚠️ No Changeset found

Latest commit: 0b91cc8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kdy1
Copy link
Member Author

kdy1 commented Mar 27, 2024

The performance actually regressed.

Starting recording with the Time Profiler template. Launching process: parser-b740e19dcb07a563.
Ctrl-C to stop the recording
Gnuplot not found, using plotters backend
Benchmarking es/parser/colors
Benchmarking es/parser/colors: Warming up for 3.0000 s
Benchmarking es/parser/colors: Collecting 100 samples in estimated 5.0518 s (379k iterations)
Benchmarking es/parser/colors: Analyzing
es/parser/colors        time:   [13.219 µs 13.234 µs 13.248 µs]
                        change: [+1.6279% +2.0811% +2.5388%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 15 outliers among 100 measurements (15.00%)
  3 (3.00%) low severe
  4 (4.00%) low mild
  4 (4.00%) high mild
  4 (4.00%) high severe

Benchmarking es/parser/angular
Benchmarking es/parser/angular: Warming up for 3.0000 s
Benchmarking es/parser/angular: Collecting 100 samples in estimated 5.5612 s (800 iterations)
Benchmarking es/parser/angular: Analyzing
es/parser/angular       time:   [6.7614 ms 6.7870 ms 6.8175 ms]
                        change: [+3.0888% +3.5027% +3.9238%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

Benchmarking es/parser/backbone
Benchmarking es/parser/backbone: Warming up for 3.0000 s
Benchmarking es/parser/backbone: Collecting 100 samples in estimated 9.2027 s (10k iterations)
Benchmarking es/parser/backbone: Analyzing
es/parser/backbone      time:   [892.45 µs 894.34 µs 896.45 µs]
                        change: [+2.2134% +2.8471% +3.4264%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

Benchmarking es/parser/jquery
Benchmarking es/parser/jquery: Warming up for 3.0000 s
Benchmarking es/parser/jquery: Collecting 100 samples in estimated 5.1279 s (1000 iterations)
Benchmarking es/parser/jquery: Analyzing
es/parser/jquery        time:   [5.0261 ms 5.0340 ms 5.0435 ms]
                        change: [+1.9508% +2.2250% +2.4789%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 13 outliers among 100 measurements (13.00%)
  5 (5.00%) high mild
  8 (8.00%) high severe

Benchmarking es/parser/jquery mobile
Benchmarking es/parser/jquery mobile: Warming up for 3.0000 s
Benchmarking es/parser/jquery mobile: Collecting 100 samples in estimated 5.4763 s (700 iterations)
Benchmarking es/parser/jquery mobile: Analyzing
es/parser/jquery mobile time:   [7.6303 ms 7.6467 ms 7.6677 ms]
                        change: [+1.8993% +2.2899% +2.6483%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe

Benchmarking es/parser/mootools
Benchmarking es/parser/mootools: Warming up for 3.0000 s
Benchmarking es/parser/mootools: Collecting 100 samples in estimated 5.1168 s (1300 iterations)
Benchmarking es/parser/mootools: Analyzing
es/parser/mootools      time:   [3.8887 ms 3.8957 ms 3.9043 ms]
                        change: [+1.9129% +2.1881% +2.4554%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 16 outliers among 100 measurements (16.00%)
  1 (1.00%) low mild
  8 (8.00%) high mild
  7 (7.00%) high severe

Benchmarking es/parser/underscore
Benchmarking es/parser/underscore: Warming up for 3.0000 s
Benchmarking es/parser/underscore: Collecting 100 samples in estimated 7.8020 s (10k iterations)
Benchmarking es/parser/underscore: Analyzing
es/parser/underscore    time:   [763.70 µs 764.46 µs 765.44 µs]
                        change: [+1.2490% +1.7991% +2.3571%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 13 outliers among 100 measurements (13.00%)
  3 (3.00%) high mild
  10 (10.00%) high severe

Benchmarking es/parser/three
Benchmarking es/parser/three: Warming up for 3.0000 s
Benchmarking es/parser/three: Collecting 100 samples in estimated 6.7034 s (300 iterations)
Benchmarking es/parser/three: Analyzing
es/parser/three         time:   [21.836 ms 21.890 ms 21.958 ms]
                        change: [+1.8859% +2.2254% +2.5858%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 14 outliers among 100 measurements (14.00%)
  6 (6.00%) high mild
  8 (8.00%) high severe

Benchmarking es/parser/yui
Benchmarking es/parser/yui: Warming up for 3.0000 s
Benchmarking es/parser/yui: Collecting 100 samples in estimated 5.0038 s (1300 iterations)
Benchmarking es/parser/yui: Analyzing
es/parser/yui           time:   [3.8376 ms 3.8446 ms 3.8535 ms]
                        change: [+0.7458% +1.2939% +1.7518%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe

I'll try ASCII optimization

@kdy1
Copy link
Member Author

kdy1 commented Mar 27, 2024

It's a bit slower even with ascii optimization.

Starting recording with the Time Profiler template. Launching process: parser-b740e19dcb07a563.
Ctrl-C to stop the recording
Gnuplot not found, using plotters backend
Benchmarking es/parser/colors
Benchmarking es/parser/colors: Warming up for 3.0000 s
Benchmarking es/parser/colors: Collecting 100 samples in estimated 5.0362 s (384k iterations)
Benchmarking es/parser/colors: Analyzing
es/parser/colors        time:   [13.016 µs 13.054 µs 13.102 µs]
                        change: [+0.1338% +0.5817% +1.0055%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 20 outliers among 100 measurements (20.00%)
  5 (5.00%) low severe
  11 (11.00%) low mild
  1 (1.00%) high mild
  3 (3.00%) high severe

Benchmarking es/parser/angular
Benchmarking es/parser/angular: Warming up for 3.0000 s
Benchmarking es/parser/angular: Collecting 100 samples in estimated 5.4323 s (800 iterations)
Benchmarking es/parser/angular: Analyzing
es/parser/angular       time:   [6.5944 ms 6.6080 ms 6.6253 ms]
                        change: [+0.5313% +0.7733% +1.0688%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 19 outliers among 100 measurements (19.00%)
  3 (3.00%) low mild
  4 (4.00%) high mild
  12 (12.00%) high severe

Benchmarking es/parser/backbone
Benchmarking es/parser/backbone: Warming up for 3.0000 s
Benchmarking es/parser/backbone: Collecting 100 samples in estimated 8.9748 s (10k iterations)
Benchmarking es/parser/backbone: Analyzing
es/parser/backbone      time:   [873.34 µs 874.72 µs 876.45 µs]
                        change: [+0.2223% +0.8462% +1.4447%] (p = 0.01 < 0.05)
                        Change within noise threshold.
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) high mild
  9 (9.00%) high severe

Benchmarking es/parser/jquery
Benchmarking es/parser/jquery: Warming up for 3.0000 s
Benchmarking es/parser/jquery: Collecting 100 samples in estimated 5.0055 s (1000 iterations)
Benchmarking es/parser/jquery: Analyzing
es/parser/jquery        time:   [4.9462 ms 4.9576 ms 4.9729 ms]
                        change: [+0.3647% +0.6720% +1.0585%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe

Benchmarking es/parser/jquery mobile
Benchmarking es/parser/jquery mobile: Warming up for 3.0000 s
Benchmarking es/parser/jquery mobile: Collecting 100 samples in estimated 5.3931 s (700 iterations)
Benchmarking es/parser/jquery mobile: Analyzing
es/parser/jquery mobile time:   [7.5162 ms 7.5264 ms 7.5391 ms]
                        change: [+0.3279% +0.6804% +0.9863%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe

Benchmarking es/parser/mootools
Benchmarking es/parser/mootools: Warming up for 3.0000 s
Benchmarking es/parser/mootools: Collecting 100 samples in estimated 5.0082 s (1300 iterations)
Benchmarking es/parser/mootools: Analyzing
es/parser/mootools      time:   [3.8306 ms 3.8457 ms 3.8651 ms]
                        change: [+0.4605% +0.8765% +1.4507%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 14 outliers among 100 measurements (14.00%)
  6 (6.00%) high mild
  8 (8.00%) high severe

Benchmarking es/parser/underscore
Benchmarking es/parser/underscore: Warming up for 3.0000 s
Benchmarking es/parser/underscore: Collecting 100 samples in estimated 7.6556 s (10k iterations)
Benchmarking es/parser/underscore: Analyzing
es/parser/underscore    time:   [751.47 µs 752.78 µs 754.50 µs]
                        change: [-0.5024% +0.0448% +0.6749%] (p = 0.89 > 0.05)
                        No change in performance detected.
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe

Benchmarking es/parser/three
Benchmarking es/parser/three: Warming up for 3.0000 s
Benchmarking es/parser/three: Collecting 100 samples in estimated 6.5835 s (300 iterations)
Benchmarking es/parser/three: Analyzing
es/parser/three         time:   [21.547 ms 21.604 ms 21.675 ms]
                        change: [+0.5606% +0.8868% +1.2536%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 14 outliers among 100 measurements (14.00%)
  6 (6.00%) high mild
  8 (8.00%) high severe

Benchmarking es/parser/yui
Benchmarking es/parser/yui: Warming up for 3.0000 s
Benchmarking es/parser/yui: Collecting 100 samples in estimated 5.3409 s (1400 iterations)
Benchmarking es/parser/yui: Analyzing
es/parser/yui           time:   [3.8010 ms 3.8063 ms 3.8125 ms]
                        change: [-0.2432% +0.2851% +0.7039%] (p = 0.27 > 0.05)
                        No change in performance detected.
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe

Target app exited, ending recording...
Recording completed. Saving output file...
Output file saved as: parser-b740e19dcb07a563_time_2024-03-27_154936-161.trace

@kdy1 kdy1 closed this Mar 27, 2024
@kdy1 kdy1 deleted the unicode branch March 27, 2024 06:52
@Boshen
Copy link
Contributor

Boshen commented Mar 27, 2024

Wouldn't it just be noise if none of the test files contain any unicode 🤔

@kdy1 kdy1 restored the unicode branch March 27, 2024 07:28
@kdy1
Copy link
Member Author

kdy1 commented Mar 27, 2024

Oops you are right

@kdy1 kdy1 reopened this Mar 27, 2024
@kdy1 kdy1 marked this pull request as ready for review April 1, 2024 01:04
@kdy1 kdy1 requested review from a team as code owners April 1, 2024 01:04
@kdy1 kdy1 enabled auto-merge (squash) April 1, 2024 01:04
Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_core
  • swc_ecma_parser

Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit 6f780ca into swc-project:main Apr 1, 2024
142 checks passed
@kdy1 kdy1 deleted the unicode branch April 1, 2024 02:01
@kdy1 kdy1 modified the milestones: Planned, v1.4.12 Apr 4, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators May 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants