Stop sorting after every profiler datum comes in.

This commit is contained in:
Patrick Walton 2013-06-12 17:36:56 -07:00
parent badf1b8573
commit f3cdbaf611
2 changed files with 19 additions and 17 deletions

View file

@ -206,8 +206,7 @@ impl BlockFlowData {
MaybeAuto::from_margin(style.margin_left(), remaining_width),
MaybeAuto::from_margin(style.margin_right(), remaining_width));
// FIXME(pcwalton): We discard the width here. Is that correct?
let (_, margin_left, margin_right) = self.compute_horiz(width,
let (width, margin_left, margin_right) = self.compute_horiz(width,
margin_left,
margin_right,
available_width);

View file

@ -151,7 +151,6 @@ impl ProfilerContext {
match self.buckets[category as uint] {
(_, ref mut data) => {
data.push(t);
tim_sort(*data);
}
}
@ -171,8 +170,10 @@ impl ProfilerContext {
println(fmt!("%31s %15s %15s %15s %15s %15s",
"_category (ms)_", "_mean (ms)_", "_median (ms)_",
"_min (ms)_", "_max (ms)_", "_bucket size_"));
for self.buckets.each |bucket| {
let &(category, data) = bucket;
for vec::each_mut(self.buckets) |bucket| {
match *bucket {
(category, ref mut data) => {
tim_sort(*data);
let data_len = data.len();
if data_len > 0 {
let (mean, median, min, max) =
@ -184,6 +185,8 @@ impl ProfilerContext {
category.format(), mean, median, min, max, data_len));
}
}
}
}
println("");
}
}