question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sealing hashing takes forever when hot: true

See original GitHub issue

Bug report

Performance for hot: true seems to be pretty bad, taking a 12s compile to a 110s compile. And it seems to be completely dependent on a slowing hashing function from webpack-sources. It only appears when you have lots of small files, like 3k+. Here’s the last status update by the progress flag:

[webpack.Progress] 65% building 4/4 entries 26696/26696 dependencies 6288/6288 modules

It seems to be thrashing memory-wise, as you can see by the second image it’s spending 37s in GC.

What is the current behavior?

It seems when there is a lot of files, webpack exponentially slowes down.

Since this project is scala.js I can generate javascript files two different ways

  1. With lots of small files
  2. With fewest files.

So for the first one, here is a chart: image And the bottoms up view (Heavy methods) image

And for the second one here is another chart, which looks normal. image

Practically this is the same code just organized differently.

If the current behavior is a bug, please provide the steps to reproduce.

I’ll try to find a way to give some code where it’s reproducible, but I have something like 3195 files just in my project not including dependencies in the first option. And 30 files with the second one.

What is the expected behavior?

Have linear performance with regard to the number of files processed by webpack.

Other relevant information: webpack version: 5.45.1 Node.js version: v14.17.0 Operating System: Linux Additional tools:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dispaltcommented, Jul 20, 2021

And, just confirmed it is totally fixed, wow, thank you @sokra!

1reaction
sokracommented, Jul 19, 2021

Thanks that was very useful. I’ll see tomorrow if that can be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[webpack 5] rebuild is twice as slow comparing to webpack 4
After upgrading to webpack 5 in our project we noticed that rebuild time increased more than 2 times comparing to webpack 4.
Read more >
Angular 12 - Generating browser application bundles (phase
I too upgraded an Angular 8 application to 13 and noticed a huge degradation in the sealing phase time during the edit-compile cycle...
Read more >
Keep webpack Fast: A Field Guide for Better Build Performance
Keep webpack Fast: A Field Guide for Better Build Performance ... webpack is a brilliant tool for bundling frontend assets. When things start...
Read more >
Everything You Need to Know About Storing Solventless Hash ...
Always let hash warm up before opening the jar to prevent condensation from forming and destroying the hash. These are the basics that...
Read more >
Webpack 5 release (2020-10-10)
Webpack 5 will use a real hash of the file content when using [contenthash] now. Before it "only" used a hash of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found