Unverified Commit 947367aa authored by gaaclarke's avatar gaaclarke Committed by GitHub

Added standard deviation to rasterizer results. (#131781)

This calculation is important if you want to calculate the probability that one thing is better than another.
parent 4b176a71
...@@ -189,6 +189,7 @@ class GalleryTransitionTest { ...@@ -189,6 +189,7 @@ class GalleryTransitionTest {
'90th_percentile_frame_build_time_millis', '90th_percentile_frame_build_time_millis',
'99th_percentile_frame_build_time_millis', '99th_percentile_frame_build_time_millis',
'average_frame_rasterizer_time_millis', 'average_frame_rasterizer_time_millis',
'stddev_frame_rasterizer_time_millis',
'worst_frame_rasterizer_time_millis', 'worst_frame_rasterizer_time_millis',
'90th_percentile_frame_rasterizer_time_millis', '90th_percentile_frame_rasterizer_time_millis',
'99th_percentile_frame_rasterizer_time_millis', '99th_percentile_frame_rasterizer_time_millis',
......
...@@ -82,6 +82,20 @@ class TimelineSummary { ...@@ -82,6 +82,20 @@ class TimelineSummary {
return _averageInMillis(_extractGpuRasterizerDrawDurations()); return _averageInMillis(_extractGpuRasterizerDrawDurations());
} }
/// Standard deviation amount of time spent per frame in the engine rasterizer.
///
/// Throws a [StateError] if this summary contains no timeline events.
double computeStandardDeviationFrameRasterizerTimeMillis() {
final List<Duration> durations = _extractGpuRasterizerDrawDurations();
final double average = _averageInMillis(durations);
double tally = 0.0;
for (final Duration duration in durations) {
final double time = duration.inMicroseconds.toDouble() / 1000.0;
tally += (average - time).abs();
}
return tally / durations.length;
}
/// The longest frame rasterization time in milliseconds. /// The longest frame rasterization time in milliseconds.
/// ///
/// Throws a [StateError] if this summary contains no timeline events. /// Throws a [StateError] if this summary contains no timeline events.
...@@ -146,6 +160,9 @@ class TimelineSummary { ...@@ -146,6 +160,9 @@ class TimelineSummary {
/// * "average_frame_rasterizer_time_millis": Average amount of time spent /// * "average_frame_rasterizer_time_millis": Average amount of time spent
/// per frame in the engine rasterizer. /// per frame in the engine rasterizer.
/// See [computeAverageFrameRasterizerTimeMillis]. /// See [computeAverageFrameRasterizerTimeMillis].
/// * "stddev_frame_rasterizer_time_millis": Standard deviation of the amount
/// of time spent per frame in the engine rasterizer.
/// See [computeStandardDeviationFrameRasterizerTimeMillis].
/// * "90th_percentile_frame_rasterizer_time_millis" and /// * "90th_percentile_frame_rasterizer_time_millis" and
/// "99th_percentile_frame_rasterizer_time_millis": The 90/99-th percentile /// "99th_percentile_frame_rasterizer_time_millis": The 90/99-th percentile
/// frame rasterization time in milliseconds. /// frame rasterization time in milliseconds.
...@@ -240,6 +257,7 @@ class TimelineSummary { ...@@ -240,6 +257,7 @@ class TimelineSummary {
'worst_frame_build_time_millis': computeWorstFrameBuildTimeMillis(), 'worst_frame_build_time_millis': computeWorstFrameBuildTimeMillis(),
'missed_frame_build_budget_count': computeMissedFrameBuildBudgetCount(), 'missed_frame_build_budget_count': computeMissedFrameBuildBudgetCount(),
'average_frame_rasterizer_time_millis': computeAverageFrameRasterizerTimeMillis(), 'average_frame_rasterizer_time_millis': computeAverageFrameRasterizerTimeMillis(),
'stddev_frame_rasterizer_time_millis': computeStandardDeviationFrameRasterizerTimeMillis(),
'90th_percentile_frame_rasterizer_time_millis': computePercentileFrameRasterizerTimeMillis(90.0), '90th_percentile_frame_rasterizer_time_millis': computePercentileFrameRasterizerTimeMillis(90.0),
'99th_percentile_frame_rasterizer_time_millis': computePercentileFrameRasterizerTimeMillis(99.0), '99th_percentile_frame_rasterizer_time_millis': computePercentileFrameRasterizerTimeMillis(99.0),
'worst_frame_rasterizer_time_millis': computeWorstFrameRasterizerTimeMillis(), 'worst_frame_rasterizer_time_millis': computeWorstFrameRasterizerTimeMillis(),
......
...@@ -463,6 +463,7 @@ void main() { ...@@ -463,6 +463,7 @@ void main() {
'worst_frame_build_time_millis': 19.0, 'worst_frame_build_time_millis': 19.0,
'missed_frame_build_budget_count': 2, 'missed_frame_build_budget_count': 2,
'average_frame_rasterizer_time_millis': 16.0, 'average_frame_rasterizer_time_millis': 16.0,
'stddev_frame_rasterizer_time_millis': 4.0,
'90th_percentile_frame_rasterizer_time_millis': 20.0, '90th_percentile_frame_rasterizer_time_millis': 20.0,
'99th_percentile_frame_rasterizer_time_millis': 20.0, '99th_percentile_frame_rasterizer_time_millis': 20.0,
'worst_frame_rasterizer_time_millis': 20.0, 'worst_frame_rasterizer_time_millis': 20.0,
...@@ -578,6 +579,7 @@ void main() { ...@@ -578,6 +579,7 @@ void main() {
'99th_percentile_frame_build_time_millis': 19.0, '99th_percentile_frame_build_time_millis': 19.0,
'missed_frame_build_budget_count': 2, 'missed_frame_build_budget_count': 2,
'average_frame_rasterizer_time_millis': 16.0, 'average_frame_rasterizer_time_millis': 16.0,
'stddev_frame_rasterizer_time_millis': 4.0,
'90th_percentile_frame_rasterizer_time_millis': 20.0, '90th_percentile_frame_rasterizer_time_millis': 20.0,
'99th_percentile_frame_rasterizer_time_millis': 20.0, '99th_percentile_frame_rasterizer_time_millis': 20.0,
'worst_frame_rasterizer_time_millis': 20.0, 'worst_frame_rasterizer_time_millis': 20.0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment