additional performance improvement for chunks with single source type

This commit is contained in:
Tobias Koppers 2019-11-20 15:27:38 +01:00
parent fe67677f55
commit 3378ac21cf
1 changed files with 7 additions and 0 deletions

View File

@ -78,6 +78,13 @@ const modulesBySourceType = set => {
innerSet.add(module);
}
}
for (const [key, innerSet] of map) {
// When all modules have the source type, we reuse the original SortableSet
// to benefit from the shared cache (especially for sorting)
if (innerSet.size === set.size) {
map.set(key, set);
}
}
return map;
};