You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
html-webpack-plugin currently uses Bluebird promises, which use try...catch. Such blocks are a known de-optimization (GoogleChrome/devtools-docs#53 (comment)) in some versions of V8, like the one present in Node 6 (current LTS). Node 6 also has native promise support though.
Thus using Bluebird promises can cause decreased performance. Below are a few screenshots of a Webpack rebuild, showing the deopt is occurring (all within the innerArrayForEach group):
I tried replacing this specific use of Promise (it's the one in html-webpack-plugin/lib/compiler.js (compileTemplate) with a native promise and I observed roughly 200ms savings on a rebuild in that function group:
This doesn't mean that all builds would benefit from the same reduction, but since rebuild performance is of high value perhaps this is a worthwhile refactor.
Description
This is a feature/refactor request.
html-webpack-plugin
currently uses Bluebird promises, which usetry...catch
. Such blocks are a known de-optimization (GoogleChrome/devtools-docs#53 (comment)) in some versions of V8, like the one present in Node 6 (current LTS). Node 6 also has native promise support though.Thus using Bluebird promises can cause decreased performance. Below are a few screenshots of a Webpack rebuild, showing the deopt is occurring (all within the
innerArrayForEach
group):I tried replacing this specific use of Promise (it's the one in

html-webpack-plugin/lib/compiler.js (compileTemplate)
with a native promise and I observed roughly 200ms savings on a rebuild in that function group:This doesn't mean that all builds would benefit from the same reduction, but since rebuild performance is of high value perhaps this is a worthwhile refactor.
It's worth mentioning that in the V8 engine 6.0 this isn't relevant anymore: https://www.nearform.com/blog/node-js-is-getting-a-new-v8-with-turbofan. But that might be a ways off for a lot of users.
Environment
The text was updated successfully, but these errors were encountered: