Commit 2b10a256 authored by Tobias Koppers's avatar Tobias Koppers

Turbopack: only show database timing when it's slower than a second

parent bf8cadd8
......@@ -1184,10 +1184,12 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
if new_items {
let elapsed = start.elapsed();
turbo_tasks().send_compilation_event(Arc::new(TimingEvent::new(
"Finished writing to filesystem cache".to_string(),
elapsed,
)));
if elapsed.as_secs() >= 1 {
turbo_tasks().send_compilation_event(Arc::new(TimingEvent::new(
"Finished writing to filesystem cache".to_string(),
elapsed,
)));
}
}
Some((snapshot_time, new_items))
......
......@@ -135,8 +135,10 @@ fn do_compact(
})?;
if ran {
let elapsed = start.elapsed();
turbo_tasks()
.send_compilation_event(Arc::new(TimingEvent::new(message.to_string(), elapsed)));
if elapsed.as_secs() >= 1 {
turbo_tasks()
.send_compilation_event(Arc::new(TimingEvent::new(message.to_string(), elapsed)));
}
}
Ok(())
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment