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.

Webpack 5 production build takes ~20% more time than in webpack 4

See original GitHub issue

Bug report

What is the current behavior?

Production build in webpack 5 takes approximatly 20% more time to complete than in webpack 4. Turn minimization off via optimization.minimize makes webpack 5 actually faster then webpack 4.

Providing result of 10 build runs by webpack 4 and by webpack 5:

webpack 4: 6.135080679988861 seconds
webpack 5: 7.854557122190793 seconds

If the current behavior is a bug, please provide the steps to reproduce. Repo for reproducing https://github.com/SkReD/webpack5-performance-issue

What is the expected behavior? Build time is bigger about 0 - 5% maximum. Should be possible to configure optimization for reducing build time to webpack 4 values.

Other relevant information: webpack version: 5.38.1 Node.js version: 16.3.0 (–cpu-profile fails on current LTS) Operating System: windows 10 x64 Additional tools:

Providing logs of last runs from bench run

webpack 4 profile logs main-process.cpuprofile main-process

child-process.cpuprofile child-process

webpack 5 profile logs main-process.cpuprofile main-process

child-process.cpuprofile child-process

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
alexander-akaitcommented, Jun 4, 2021

@SkReD I will look at repos in near future

0reactions
SkReDcommented, Jun 4, 2021

Also try to disable parallels (i.e. parallels)

Disabling parallel didn’t help

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 >
How to boost the speed of your webpack build?
Depending on the machine on which the build was launched, it took between 5 and 12 minutes. It is not possible to have...
Read more >
Build Performance - webpack
This guide contains some useful tips for improving build/compilation performance. General. The following best practices should help, whether you're running ...
Read more >
Upgrading Webpack 4 → 5 | Square Corner Blog
Waaay faster dev builds With persistent caching, our dev builds were as fast as 20 seconds compared to the 2~3 minutes we're used...
Read more >
Speeding Up Webpack - Stephen Cook Dev
Caching on production builds that should be running from scratch each time anyway will just be slowing you down. Time saved: 15 seconds...
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