Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: tools/profviz/composer.js

Issue 319703009: Do not merge adjourning ranges when calculating percentages in plot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebaseline test Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/tools/profviz-test.default ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 function DrawHalfBar(row, color, start, end, width) { 407 function DrawHalfBar(row, color, start, end, width) {
408 DrawBarBase(color, start, end, row, row - width); 408 DrawBarBase(color, start, end, row, row - width);
409 } 409 }
410 410
411 var percentages = {}; 411 var percentages = {};
412 var total = 0; 412 var total = 0;
413 for (var name in TimerEvents) { 413 for (var name in TimerEvents) {
414 var event = TimerEvents[name]; 414 var event = TimerEvents[name];
415 var ranges = RestrictRangesTo(event.ranges, range_start, range_end); 415 var ranges = RestrictRangesTo(event.ranges, range_start, range_end);
416 ranges = MergeRanges(ranges);
417 var sum = 416 var sum =
418 ranges.map(function(range) { return range.duration(); }) 417 ranges.map(function(range) { return range.duration(); })
419 .reduce(function(a, b) { return a + b; }, 0); 418 .reduce(function(a, b) { return a + b; }, 0);
420 percentages[name] = (sum / (range_end - range_start) * 100).toFixed(1); 419 percentages[name] = (sum / (range_end - range_start) * 100).toFixed(1);
421 } 420 }
422 421
423 // Plot deopts. 422 // Plot deopts.
424 deopts.sort(function(a, b) { return b.size - a.size; }); 423 deopts.sort(function(a, b) { return b.size - a.size; });
425 var max_deopt_size = deopts.length > 0 ? deopts[0].size : Infinity; 424 var max_deopt_size = deopts.length > 0 ? deopts[0].size : Infinity;
426 425
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 output("plot '-' using 1:2 axes x1y2 with impulses ls 1"); 524 output("plot '-' using 1:2 axes x1y2 with impulses ls 1");
526 for (var i = 0; i < execution_pauses.length; i++) { 525 for (var i = 0; i < execution_pauses.length; i++) {
527 var pause = execution_pauses[i]; 526 var pause = execution_pauses[i];
528 output(pause.end + " " + pause.duration()); 527 output(pause.end + " " + pause.duration());
529 obj_index++; 528 obj_index++;
530 } 529 }
531 output("e"); 530 output("e");
532 return obj_index; 531 return obj_index;
533 }; 532 };
534 } 533 }
OLDNEW
« no previous file with comments | « test/mjsunit/tools/profviz-test.default ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698