Skip to content

perf(core): replace neo-async with a minimal helper#8282

Merged
chenjiahan merged 2 commits intomainfrom
neo_async_1031
Oct 31, 2024
Merged

perf(core): replace neo-async with a minimal helper#8282
chenjiahan merged 2 commits intomainfrom
neo_async_1031

Conversation

@chenjiahan
Copy link
Copy Markdown
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
@netlify
Copy link
Copy Markdown

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
Copy Markdown
Member Author

!eco-ci

@rspack-bot
Copy link
Copy Markdown

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
@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