Changeset 194661 in webkit


Ignore:
Timestamp:
Jan 6, 2016 1:16:54 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

The sampling of time series on v3 UI is too aggressive
https://bugs.webkit.org/show_bug.cgi?id=152804

Reviewed by Chris Dumez.

Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
and increased the number of data points allowed to make the sampling less aggressive.

  • public/v3/components/time-series-chart.js:

(TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
to 2x the number of pixels divided by the radius of each point.
(TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
to mean the index after the last point and renamed it to indexAfterEnd.
(TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
data points into one sampled data point despite of the fact i and j are sufficiently apart
since data[j].time - data[i].time > timePerSample by definition.

Location:
trunk/Websites/perf.webkit.org
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r194657 r194661  
     12016-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
    1202016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/Websites/perf.webkit.org/public/v3/components/time-series-chart.js

    r194653 r194661  
    438438                return null;
    439439
    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;
    442442
    443443            var pointAfterStart = timeSeries.findPointAfterTime(startTime);
     
    449449            // FIXME: Move this to TimeSeries.prototype.
    450450            var filteredData = timeSeries.dataBetweenPoints(pointBeforeStart, pointAfterEnd);
    451             if (filteredData.length <= maximumNumberOfPoints || !source.sampleData)
     451            if (!source.sampleData)
    452452                return filteredData;
    453453            else
     
    468468
    469469        // 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)
    471471        {
    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; });
    473473            return sortedList[Math.floor(sortedList.length / 2)];
    474474        }
     
    494494                    break;
    495495            }
    496             if (i < j) {
     496            if (i < j - 1) {
    497497                sampledData.push(findMedian(data, i, j));
    498                 i = j + 1;
     498                i = j;
    499499            } else {
    500500                sampledData.push(startPoint);
Note: See TracChangeset for help on using the changeset viewer.