webpack/lib/optimize
Joe Lencioni 37d70bd0c6 Avoid calling hash.update multiple times in ConcatenatedModules
@sokra did some profiling and it seems that calling crypto.update
multiple times is slower than calling it once with a large string.

> As explanation I would guess update calls into node.js C++ + OpenSSL
> while concatenating strings is very optimized in JIT.

To take better advantage of this information, I have rewritten this
performance-sensitive code to build up a concatenated string and then
hash it at the end.

Since we are thinking about performance here, I opted for a regular for
loop instead of using the forEach iterator. I also did some basic
benchmarking of string concatenation strategies and discovered that
separating out the addition of the extra space into its own
concatenation line instead of tacking it on to the end of a single
concatenation might just barely have the edge in terms of performance. I
think it is also very readable this way, so it seems like a good
tradeoff to make: a little lost conciseness for speed.
2017-11-23 08:31:16 -08:00
..
AggressiveMergingPlugin.js refactor for more readablity 2017-07-24 10:04:55 +02:00
AggressiveSplittingPlugin.js performance improvements and comments 2017-07-18 14:24:42 +02:00
ChunkModuleIdRangePlugin.js refactor: use array.find vs array.filter()[0] 2017-07-17 22:19:35 -04:00
CommonsChunkPlugin.js cleanup CommonsChunkPlugins changes 2017-10-13 10:36:08 +02:00
ConcatenatedModule.js Avoid calling hash.update multiple times in ConcatenatedModules 2017-11-23 08:31:16 -08:00
DedupePlugin.js improve wording in DedupePlugin error 2017-02-23 23:28:05 +11:00
EnsureChunkConditionsPlugin.js Ensure that graph structure stay consistent 2017-08-16 14:05:06 +02:00
FlagIncludedChunksPlugin.js improve a few issues 2017-05-20 14:54:42 +02:00
LimitChunkCountPlugin.js Merge pull request #4205 from timse/use-let-const-as-blockscoped-variables 2017-02-08 09:44:03 +01:00
MergeDuplicateChunksPlugin.js optimize optimization plugins 2017-06-01 16:35:07 +02:00
MinChunkSizePlugin.js fix bug in MinChunkSizePlugin 2017-03-22 12:09:22 +01:00
ModuleConcatenationPlugin.js Ensure that graph structure stay consistent 2017-08-16 14:05:06 +02:00
OccurrenceOrderPlugin.js optimize OccurenceOrderPlugin 2017-06-02 01:24:55 +02:00
RemoveEmptyChunksPlugin.js refactor(ES6) upgrade RemoveEmptyChunksPlugin to ES6 (#3765) 2017-01-05 10:48:16 -06:00
RemoveParentModulesPlugin.js Merge branch 'next' into perf/modules-set 2017-05-16 14:37:03 +02:00
UglifyJsPlugin.js feat(uglify): move uglify to external plugin from webpack-contrib 2017-06-07 12:35:50 -05:00