Skip to content

perf: cache module size in NormalModule - #9719

Merged
sokra merged 1 commit into
webpack:masterfrom
hedgepigdaniel:perf/NormalModule-size
Sep 23, 2019
Merged

perf: cache module size in NormalModule#9719
sokra merged 1 commit into
webpack:masterfrom
hedgepigdaniel:perf/NormalModule-size

Conversation

@hedgepigdaniel

@hedgepigdaniel hedgepigdaniel commented Sep 20, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

For maintainers only:

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

@webpack-bot

Copy link
Copy Markdown
Contributor

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

@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

sokra commented Sep 23, 2019

Copy link
Copy Markdown
Member

Thanks

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.

3 participants