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

Unified Diff: tracing/tracing/model/model.html

Issue 2016863004: Removed the isTimeHighResolutionHeuristic_ heuristic. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tracing/tracing/model/model_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/model/model.html
diff --git a/tracing/tracing/model/model.html b/tracing/tracing/model/model.html
index 8cc5f9b6329d963247dc0fcd98a4ffa7d2372934..113e984c556850ed793d7e704f77b28c4c33cdac 100644
--- a/tracing/tracing/model/model.html
+++ b/tracing/tracing/model/model.html
@@ -104,7 +104,7 @@ tr.exportTo('tr', function() {
this.importWarnings_ = [];
this.reportedImportWarnings_ = {};
- this.isTimeHighResolution_ = undefined;
+ this.isTimeHighResolution_ = true;
this.patchupsToApply_ = [];
@@ -393,16 +393,10 @@ tr.exportTo('tr', function() {
},
get isTimeHighResolution() {
- if (this.isTimeHighResolution_ === undefined)
- this.isTimeHighResolution_ = this.isTimeHighResolutionHeuristic_();
return this.isTimeHighResolution_;
},
set isTimeHighResolution(value) {
- if (this.isTimeHighResolution_ === value)
- return;
- if (this.isTimeHighResolution_ !== undefined)
- throw new Error('isTimeHighResolution already set');
this.isTimeHighResolution_ = value;
},
@@ -573,38 +567,6 @@ tr.exportTo('tr', function() {
});
},
- isTimeHighResolutionHeuristic_: function() {
- if (this.intrinsicTimeUnit !== tr.v.TimeDisplayModes.ms)
- return false;
- // If the timer is only precise to the millisecond, then almost all event
- // will be precisely X ms apart. We check that by looking at the
- // decimal part of each event's start time. We create 100 bins for
- // these fractions. If at least 90% of the events are in the same bin then
- // the timer is deemed to be low resolution.
- var nbEvents = 0;
- var nbPerBin = [];
- var maxEvents = 0;
- for (var i = 0; i < 100; ++i)
- nbPerBin.push(0);
- this.iterateAllEvents(function(event) {
- nbEvents++;
- if (event.start !== undefined) {
- // Compute
- var remainder = Math.floor(
- (event.start - Math.floor(event.start)) * 100);
- nbPerBin[remainder]++;
- maxEvents = Math.max(maxEvents, nbPerBin[remainder]);
- }
- });
- // If there are too few events our heuristic is not very good, assume the
- // timer is high resolution.
- if (nbEvents < 100)
- return true;
- // If more than 90% of the events are snapped precisely on milliseconds
- // boundary we got a trace with a low resolution timer.
- return (maxEvents / nbEvents) < 0.9;
- },
-
/**
* Called by the model to join references between objects, after final model
* bounds have been computed.
« no previous file with comments | « no previous file | tracing/tracing/model/model_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698