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> { ...@@ -1184,10 +1184,12 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
if new_items { if new_items {
let elapsed = start.elapsed(); let elapsed = start.elapsed();
turbo_tasks().send_compilation_event(Arc::new(TimingEvent::new( if elapsed.as_secs() >= 1 {
"Finished writing to filesystem cache".to_string(), turbo_tasks().send_compilation_event(Arc::new(TimingEvent::new(
elapsed, "Finished writing to filesystem cache".to_string(),
))); elapsed,
)));
}
} }
Some((snapshot_time, new_items)) Some((snapshot_time, new_items))
......
...@@ -135,8 +135,10 @@ fn do_compact( ...@@ -135,8 +135,10 @@ fn do_compact(
})?; })?;
if ran { if ran {
let elapsed = start.elapsed(); let elapsed = start.elapsed();
turbo_tasks() if elapsed.as_secs() >= 1 {
.send_compilation_event(Arc::new(TimingEvent::new(message.to_string(), elapsed))); turbo_tasks()
.send_compilation_event(Arc::new(TimingEvent::new(message.to_string(), elapsed)));
}
} }
Ok(()) 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