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_left(), remaining_width),
MaybeAuto::from_margin(style.margin_right(), remaining_width)); MaybeAuto::from_margin(style.margin_right(), remaining_width));
// FIXME(pcwalton): We discard the width here. Is that correct? let (width, margin_left, margin_right) = self.compute_horiz(width,
let (_, margin_left, margin_right) = self.compute_horiz(width,
margin_left, margin_left,
margin_right, margin_right,
available_width); available_width);

View file

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