Closed SuperOleg39 closed 11 months ago
@alexander-akait Hello! Want to ask you for PR review 🙏
I am fine with it, I will merge and release this tomorrow, I want to look at code why it is slow and maybe we need to put TODO about change it in the future major release
Thanks a lot!
Say if you need any CPU profile traces for debugging.
@alexander-akait hello! Can you merge and release this fix please?
@alexander-akait hello! Just want to remind about thix fix 🙏
Sorry for delay, I will do releasae tomorrow
@SuperOleg39 Hm, until I released it, maybe we can make it more flex, let's allow to override stats options (make an option for this) and use const statsOptions = { /* Default options */ children: true, ...opts.statsOptions }
, so you can override everything and make it even faster
@SuperOleg39 Hm, until I released it, maybe we can make it more flex, let's allow to override stats options (make an option for this) and use
const statsOptions = { /* Default options */ children: true, ...opts.statsOptions }
, so you can override everything and make it even faster
@alexander-akait Something like this? https://github.com/webpack-contrib/webpack-hot-middleware/pull/444
This PR contains a:
Motivation / Use-Case
stats.toJson is a heavy method, and is called for every incremental build.
I made a webpack build performance profiling, and found that
stats.toJson
fromwebpack-hot-middleware
takes around 50ms work - while complete incremental build for small change is cost around 200-250ms fo CPU work.After trying to change statsOptions, I found that
cached: true
option is the slowest, and with disabledcached: false
fullstats.toJson
call cost around 10ms - five times faster.Looks like we don't need this option for most projects, but for backward compatibility I just add one parameter to rewrite it.
Breaking Changes
This PR is backward compatible with previous changes in https://github.com/webpack-contrib/webpack-hot-middleware/pull/336
Additional Info
CPU profiles included tramvai-cli.cached-false.cpuprofile.zip tramvai-cli.cached-true.cpuprofile.zip
No cached:
And cached, as default: