Changeset 194661 in webkit
- Timestamp:
- Jan 6, 2016 1:16:54 PM (8 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r194657 r194661 1 2016-01-06 Ryosuke Niwa <rniwa@webkit.org> 2 3 The sampling of time series on v3 UI is too aggressive 4 https://bugs.webkit.org/show_bug.cgi?id=152804 5 6 Reviewed by Chris Dumez. 7 8 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries 9 and increased the number of data points allowed to make the sampling less aggressive. 10 11 * public/v3/components/time-series-chart.js: 12 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points 13 to 2x the number of pixels divided by the radius of each point. 14 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex 15 to mean the index after the last point and renamed it to indexAfterEnd. 16 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two 17 data points into one sampled data point despite of the fact i and j are sufficiently apart 18 since data[j].time - data[i].time > timePerSample by definition. 19 1 20 2016-01-06 Ryosuke Niwa <rniwa@webkit.org> 2 21 -
trunk/Websites/perf.webkit.org/public/v3/components/time-series-chart.js
r194653 r194661 438 438 return null; 439 439 440 // A chart with X px width shouldn't have more than X / <radius-of-points> data points.441 var maximumNumberOfPoints = metrics.chartWidth / source.pointRadius;440 // A chart with X px width shouldn't have more than 2X / <radius-of-points> data points. 441 var maximumNumberOfPoints = 2 * metrics.chartWidth / source.pointRadius; 442 442 443 443 var pointAfterStart = timeSeries.findPointAfterTime(startTime); … … 449 449 // FIXME: Move this to TimeSeries.prototype. 450 450 var filteredData = timeSeries.dataBetweenPoints(pointBeforeStart, pointAfterEnd); 451 if ( filteredData.length <= maximumNumberOfPoints ||!source.sampleData)451 if (!source.sampleData) 452 452 return filteredData; 453 453 else … … 468 468 469 469 // FIXME: Do this in O(n) using quickselect: https://en.wikipedia.org/wiki/Quickselect 470 function findMedian(list, startIndex, endIndex)470 function findMedian(list, startIndex, indexAfterEnd) 471 471 { 472 var sortedList = list.slice(startIndex, endIndex + 1).sort(function (a, b) { return a.value - b.value; });472 var sortedList = list.slice(startIndex, indexAfterEnd).sort(function (a, b) { return a.value - b.value; }); 473 473 return sortedList[Math.floor(sortedList.length / 2)]; 474 474 } … … 494 494 break; 495 495 } 496 if (i < j ) {496 if (i < j - 1) { 497 497 sampledData.push(findMedian(data, i, j)); 498 i = j + 1;498 i = j; 499 499 } else { 500 500 sampledData.push(startPoint);
Note: See TracChangeset
for help on using the changeset viewer.