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

[v3.0] Improve asset emission performance #4644

Merged
merged 1 commit into from Sep 23, 2022

Conversation

lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented Sep 23, 2022

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

Breaking change: typed array/Buffer assets are no longer deduplicated.

This changes the asset emission logic in two ways:

  • To deduplicate assets with string sources, we build a reverse map source -> fileName for O(1) file name lookup. This also means that typed array/Buffer assets are no longer deduplicated for performance reasons.
  • To avoid a performance issue when using many unnamed assets, reference ids are now generated using a counter as id base for those assets (otherwise, they would use the same base which would lead to a very slow re-hashing process).

BREAKING CHANGES: Typed array sources will no longer be deduplicated
@github-actions
Copy link

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#improve-asset-emission-performance

or load it into the REPL:
https://rollupjs.org/repl/?pr=4644

@lukastaegert lukastaegert changed the base branch from master to release-3.0.0 September 23, 2022 04:39
@lukastaegert lukastaegert added this to In progress in Release 3.0.0 via automation Sep 23, 2022
@codecov
Copy link

codecov bot commented Sep 23, 2022

Codecov Report

Merging #4644 (8d6dd2f) into release-3.0.0 (52d9ca2) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@                Coverage Diff                @@
##           release-3.0.0    #4644      +/-   ##
=================================================
- Coverage          98.97%   98.97%   -0.01%     
=================================================
  Files                213      213              
  Lines               7492     7481      -11     
  Branches            2116     2112       -4     
=================================================
- Hits                7415     7404      -11     
  Misses                23       23              
  Partials              54       54              
Impacted Files Coverage Δ
src/utils/FileEmitter.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lukastaegert lukastaegert merged commit 8015be7 into release-3.0.0 Sep 23, 2022
Release 3.0.0 automation moved this from In progress to Done Sep 23, 2022
@lukastaegert lukastaegert deleted the improve-asset-emission-performance branch September 23, 2022 04:41
@lukastaegert lukastaegert mentioned this pull request Sep 23, 2022
9 tasks
@rollup-bot
Copy link
Collaborator

This PR has been released as part of rollup@3.0.0-7. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-7 or npm install rollup@beta. It will likely become part of a regular release later.

lukastaegert added a commit that referenced this pull request Oct 10, 2022
BREAKING CHANGES: Typed array sources will no longer be deduplicated

3.0.0-7
@rollup-bot
Copy link
Collaborator

This PR has been released as part of rollup@3.0.0-8. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-8 or npm install rollup@beta. It will likely become part of a regular release later.

lukastaegert added a commit that referenced this pull request Oct 11, 2022
BREAKING CHANGES: Typed array sources will no longer be deduplicated

3.0.0-7
@rollup-bot
Copy link
Collaborator

This PR has been released as part of rollup@3.0.0. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release 3.0.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants