Skip to content

Commit e78688e

Browse files
authored
perf: avoid duplicate calculate (#11020)
perf: avoid duplicate cacluate
1 parent 017369e commit e78688e

File tree

1 file changed

+4
-2
lines changed
  • crates/rspack_core/src/compiler/module_executor

1 file changed

+4
-2
lines changed

crates/rspack_core/src/compiler/module_executor/execute.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ impl Task<ExecutorTaskContext> for ExecuteTask {
130130
let mut has_error = false;
131131

132132
while let Some(m) = queue.pop_front() {
133-
modules.insert(m);
133+
// to avoid duplicate calculations in https://github.com/web-infra-dev/rspack/issues/10987
134+
if !modules.insert(m) {
135+
continue;
136+
}
134137
let module = mg.module_by_identifier(&m).expect("should have module");
135138
let build_info = module.build_info();
136139
execute_result
@@ -168,7 +171,6 @@ impl Task<ExecutorTaskContext> for ExecuteTask {
168171
}
169172
}
170173
}
171-
172174
for dep_id in module.get_dependencies() {
173175
if !has_error && make_failed_dependencies.contains(dep_id) {
174176
let dep = mg.dependency_by_id(dep_id).expect("should dep exist");

0 commit comments

Comments
 (0)