mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Stop unconditionally collecting traversal statistics in nightly builds.
The current code also makes us panic when DUMP_STYLE_STATISTICS=1 is set. :-( MozReview-Commit-ID: JWGMojOnGFK
This commit is contained in:
parent
b6de0563fb
commit
4a2e1be874
1 changed files with 5 additions and 6 deletions
|
@ -42,7 +42,6 @@ where
|
||||||
token.traversal_root().expect("Should've ensured we needed to traverse");
|
token.traversal_root().expect("Should've ensured we needed to traverse");
|
||||||
|
|
||||||
let dump_stats = traversal.shared_context().options.dump_style_statistics;
|
let dump_stats = traversal.shared_context().options.dump_style_statistics;
|
||||||
let is_nightly = traversal.shared_context().options.is_nightly();
|
|
||||||
let start_time = if dump_stats { Some(time::precise_time_s()) } else { None };
|
let start_time = if dump_stats { Some(time::precise_time_s()) } else { None };
|
||||||
|
|
||||||
// Declare the main-thread context, as well as the worker-thread contexts,
|
// Declare the main-thread context, as well as the worker-thread contexts,
|
||||||
|
@ -113,8 +112,9 @@ where
|
||||||
nodes_remaining_at_current_depth = discovered.len();
|
nodes_remaining_at_current_depth = discovered.len();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Accumulate statistics
|
|
||||||
if dump_stats || is_nightly {
|
// dump statistics to stdout if requested
|
||||||
|
if dump_stats {
|
||||||
let mut aggregate =
|
let mut aggregate =
|
||||||
mem::replace(&mut context.thread_local.statistics, Default::default());
|
mem::replace(&mut context.thread_local.statistics, Default::default());
|
||||||
let parallel = maybe_tls.is_some();
|
let parallel = maybe_tls.is_some();
|
||||||
|
@ -128,9 +128,8 @@ where
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// dump to stdout if requested
|
aggregate.finish(traversal, parallel, start_time.unwrap());
|
||||||
if dump_stats && aggregate.is_large_traversal() {
|
if aggregate.is_large_traversal() {
|
||||||
aggregate.finish(traversal, parallel, start_time.unwrap());
|
|
||||||
println!("{}", aggregate);
|
println!("{}", aggregate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue