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

Port @mraleph optimizations #2

Merged
merged 7 commits into from
Feb 7, 2021
Merged

Conversation

7rulnik
Copy link
Owner

@7rulnik 7rulnik commented Feb 7, 2021

Moved from benthemonkey#1

I spotted the article Maybe you don't need Rust and WASM to speed up your JS written by @mraleph and decided to try to port non-hardcore optimizations.

I benchmarked it with node 14.15.4.

Before:

Parsing source map
iteration: 3.590s
iteration: 3.306s
iteration: 3.459s
iteration: 3.546s
iteration: 3.379s
iteration: 3.562s
iteration: 3.319s
[Stats samples: 7, total: 24158 ms, mean: 3451.1428571428573 ms, stddev: 128.1444497432487 ms]

After:

Parsing source map
iteration: 1.030s
iteration: 1.769s
iteration: 1.104s
iteration: 1.118s
iteration: 1.189s
iteration: 1.027s
iteration: 1.104s
iteration: 1.254s
iteration: 1.041s
iteration: 1.060s
iteration: 1.140s
iteration: 1.103s
iteration: 1.124s
iteration: 1.092s
iteration: 1.098s
iteration: 1.083s
iteration: 1.068s
iteration: 1.129s
iteration: 1.067s
iteration: 1.129s
iteration: 1.090s
iteration: 1.094s
[Stats samples: 22, total: 24913 ms, mean: 1132.409090909091 ms, stddev: 154.70478799497909 ms]

@7rulnik
Copy link
Owner Author

7rulnik commented Mar 21, 2024

Applied optimizations:

  • Optimizing Sorting - Argument Adaptation
  • Optimizing Sorting - Monomorphisation
  • Optimizing Parsing - Removing Segment Cache
  • Optimizing Sorting - Algorithmic Improvements

TO DO:

  • Optimizing Parsing - Reducing GC Pressure
  • Optimizing Parsing - Using Uint8Array Instead of a String.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant