less memory, reduce timing verbosity

This commit is contained in:
Tobias Koppers 2019-07-26 08:02:30 +02:00
parent 126fb99121
commit 2e0ce0d1a9
1 changed files with 104 additions and 98 deletions

View File

@ -212,8 +212,11 @@ const visitModules = (
.reverse();
/** @type {Map<ChunkGroup, Set<ChunkGroup>>} */
const queueConnect = new Map();
/** @type {Set<ChunkGroupInfo>} */
const outdatedChunkGroupInfo = new Set();
/** @type {QueueItem[]} */
let queueDelayed = [];
logger.timeEnd("prepare");
/** @type {Module} */
@ -414,10 +417,9 @@ const visitModules = (
}
}
logger.timeEnd("visiting");
logger.time("calculating available modules");
/** @type {Set<ChunkGroupInfo>} */
const outdatedChunkGroupInfo = new Set();
if (queueConnect.size > 0) {
logger.time("calculating available modules");
// Figure out new parents for chunk groups
// to get new available modules for these children
@ -456,6 +458,7 @@ const visitModules = (
queueConnect.clear();
logger.timeEnd("calculating available modules");
if (outdatedChunkGroupInfo.size > 0) {
logger.time("merging available modules");
// Execute the merge
for (const info of outdatedChunkGroupInfo) {
@ -526,7 +529,10 @@ const visitModules = (
}
info.skippedItems.length = 0;
}
outdatedChunkGroupInfo.clear();
logger.timeEnd("merging available modules");
}
}
// Run queueDelayed when all items of the queue are processed
// This is important to get the global indicing correct