Webpack 5 triggers a slow V8 concat
path resulting in significant performance degradation in some scenarios
#14580
Labels
concat
path resulting in significant performance degradation in some scenarios
#14580
Early in Webpack 5 development the
arrayToSetDeprecation
helper was added to support migrating some objects fromArray
toSet
. In order to maintainArray
-like behaviour inconcat
the helper setsSymbol.isConcatSpreadable
. On V8, settingSymbol.isConcatSpreadable
anywhere puts all subsequent invocations ofconcat
within anIsolate
on a slow path.There are cases where this can result in significant performance degradation. In this repro case, builds go from 1s with Webpack 4 to 16s with Webpack 5. We came across this when debugging this Linaria issue, where our production build slowed from ~10s to 2m+. I wonder if this could be the cause of some issues in #12102.
The text was updated successfully, but these errors were encountered: