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: cache module size in NormalModule #9719

Merged
merged 1 commit into from Sep 23, 2019

Conversation

hedgepigdaniel
Copy link
Contributor

@hedgepigdaniel hedgepigdaniel commented Sep 20, 2019

As documented in #9718, the size function in NormalModule is a critical path with slows down watch mode recompilation. By caching the module size, this performance hit in watch mode can be avoided for modules that have not changed.

What kind of change does this PR introduce?

Refactor to improve performance

Did you add tests for your changes?

No

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

Nothing

Profile
As expected, this shaved about 2s off my incremental compile time (from ~6.5s to ~4.5s)
Before:
image
After:
image

@webpack-bot
Copy link
Contributor

webpack-bot commented Sep 20, 2019

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

@webpack-bot
Copy link
Contributor

webpack-bot commented Sep 20, 2019

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

sokra
sokra approved these changes Sep 23, 2019
@sokra sokra closed this Sep 23, 2019
@sokra sokra reopened this Sep 23, 2019
@sokra sokra merged commit d89dc70 into webpack:master Sep 23, 2019
@sokra
Copy link
Member

sokra commented Sep 23, 2019

Thanks

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

Successfully merging this pull request may close these issues.

None yet

3 participants