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

Make changes suggested by @sokra to optimize chunk graph generation #8143

Merged

Conversation

MLoughry
Copy link
Contributor

@MLoughry MLoughry commented Oct 4, 2018

Addresses concerns in #8126 by attempting to implement suggestions from @sokra to optimize Compilation.processDependenciesBlocksForChunkGroups.

  1. Filter the dependencies without modules within the for loop, rather than using .filter() to allocate a new array (lines 1870-1879)
  2. Re-use availableModule sets that only have one entry, rather than copying them (lines 1844 and 1900)
  3. Avoid expensive areModulesAvailable() call when a chunk has already survived a filter. (lines 1818-1823).

I've probably mangled sokra's ideas beyond recognition, but opening this PR so he can more easily comment on what I should do. Currently, I'm not actually seeing perf improvements from these changes.

What kind of change does this PR introduce?

Performance improvement (without any intended behavioral change)

Did you add tests for your changes?

No; as a perf change with no behavior change, I rely on the existing tests

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

N/A

@webpack-bot
Copy link
Contributor

For maintainers only:

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

@webpack-bot
Copy link
Contributor

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

@sokra sokra merged commit a868789 into webpack:master Oct 5, 2018
@sokra
Copy link
Member

sokra commented Oct 5, 2018

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