diff options
Diffstat (limited to 'crates/ra_prof/src/lib.rs')
-rw-r--r-- | crates/ra_prof/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index 845b2221c..f260c40a3 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs | |||
@@ -217,7 +217,7 @@ fn print( | |||
217 | total: Option<Duration>, | 217 | total: Option<Duration>, |
218 | ) { | 218 | ) { |
219 | let mut last = 0; | 219 | let mut last = 0; |
220 | let indent = repeat(" ").take(lvl + 1).collect::<String>(); | 220 | let indent = repeat(" ").take(lvl).collect::<String>(); |
221 | // We output hierarchy for long calls, but sum up all short calls | 221 | // We output hierarchy for long calls, but sum up all short calls |
222 | let mut short = Vec::new(); | 222 | let mut short = Vec::new(); |
223 | let mut accounted_for = Duration::default(); | 223 | let mut accounted_for = Duration::default(); |
@@ -227,7 +227,7 @@ fn print( | |||
227 | } | 227 | } |
228 | accounted_for += duration; | 228 | accounted_for += duration; |
229 | if duration >= longer_than { | 229 | if duration >= longer_than { |
230 | writeln!(out, "{} {:6}ms - {}", indent, duration.as_millis(), msg) | 230 | writeln!(out, "{}{:5}ms - {}", indent, duration.as_millis(), msg) |
231 | .expect("printing profiling info to stdout"); | 231 | .expect("printing profiling info to stdout"); |
232 | 232 | ||
233 | print(lvl + 1, &msgs[last..i], out, longer_than, Some(duration)); | 233 | print(lvl + 1, &msgs[last..i], out, longer_than, Some(duration)); |
@@ -245,14 +245,14 @@ fn print( | |||
245 | count += 1; | 245 | count += 1; |
246 | total_duration += *time; | 246 | total_duration += *time; |
247 | }); | 247 | }); |
248 | writeln!(out, "{} {:6}ms - {} ({} calls)", indent, total_duration.as_millis(), msg, count) | 248 | writeln!(out, "{}{:5}ms - {} ({} calls)", indent, total_duration.as_millis(), msg, count) |
249 | .expect("printing profiling info to stdout"); | 249 | .expect("printing profiling info to stdout"); |
250 | } | 250 | } |
251 | 251 | ||
252 | if let Some(total) = total { | 252 | if let Some(total) = total { |
253 | if let Some(unaccounted) = total.checked_sub(accounted_for) { | 253 | if let Some(unaccounted) = total.checked_sub(accounted_for) { |
254 | if unaccounted >= longer_than && last > 0 { | 254 | if unaccounted >= longer_than && last > 0 { |
255 | writeln!(out, "{} {:6}ms - ???", indent, unaccounted.as_millis()) | 255 | writeln!(out, "{}{:5}ms - ???", indent, unaccounted.as_millis()) |
256 | .expect("printing profiling info to stdout"); | 256 | .expect("printing profiling info to stdout"); |
257 | } | 257 | } |
258 | } | 258 | } |