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(core): replace neo-async with a minimal helper #8282

Merged
merged 2 commits into from
Oct 31, 2024
Merged

Conversation

chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Oct 31, 2024

Summary

neo-async contains a lot of async utilities (4k LOC) and it has not been updated for more than four years.

Rspack only uses the each() util of neo-async, so we can replace neo-async with a minimal each helper to reduce bundle size and improve startup performance.

Comparison

Compare the @rspack/core/dist/index.js bundle:

- LOC Size Load time
before 23383 772KB 65.7 ms ± 1.7 ms [User: 51.8 ms, System: 14.7 ms]
after 18843 623KB 63.3 ms ± 1.0 ms [User: 50.4 ms, System: 15.1 ms]

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack. labels Oct 31, 2024
Copy link

netlify bot commented Oct 31, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit bfefe63
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6722f791fee0e20008ca58f6

@chenjiahan
Copy link
Member Author

!eco-ci

@rspack-bot
Copy link

rspack-bot commented Oct 31, 2024

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
rspress ✅ success
rslib ✅ success
rsbuild ✅ success
examples ✅ success
devserver ✅ success

@chenjiahan chenjiahan merged commit b3ee626 into main Oct 31, 2024
31 checks passed
@chenjiahan chenjiahan deleted the neo_async_1031 branch October 31, 2024 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants