Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
ca8981b4
Unverified
Commit
ca8981b4
authored
Apr 21, 2020
by
Yegor
Committed by
GitHub
Apr 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
web benchmarks: handle no outliers case (#55126)
parent
84c84fb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
recorder.dart
dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart
+18
-1
No files found.
dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart
View file @
ca8981b4
...
...
@@ -529,10 +529,16 @@ class Timeseries {
// Final statistics.
final
double
cleanAverage
=
_computeAverage
(
name
,
cleanValues
);
final
double
outlierAverage
=
_computeAverage
(
name
,
outliers
);
final
double
standardDeviation
=
_computeStandardDeviationForPopulation
(
name
,
cleanValues
);
final
double
noise
=
cleanAverage
>
0.0
?
standardDeviation
/
cleanAverage
:
0.0
;
// Compute outlier average. If there are no outliers the outlier average is
// the same as clean value average. In other words, in a perfect benchmark
// with no noise the difference between average and outlier average is zero,
// which the best possible outcome. Noise produces a positive difference
// between the two.
final
double
outlierAverage
=
outliers
.
isNotEmpty
?
_computeAverage
(
name
,
outliers
)
:
cleanAverage
;
final
List
<
AnnotatedSample
>
annotatedValues
=
<
AnnotatedSample
>[
for
(
final
double
warmUpValue
in
warmUpValues
)
AnnotatedSample
(
...
...
@@ -631,6 +637,15 @@ class TimeseriesStats {
/// See [AnnotatedSample] for more details.
final
List
<
AnnotatedSample
>
samples
;
/// Outlier average divided by clean average.
///
/// This is a measure of performance consistency. The higher this number the
/// worse is jank when it happens. Smaller is better, with 1.0 being the
/// perfect score. If [average] is zero, this value defaults to 1.0.
double
get
outlierRatio
=>
average
>
0.0
?
outlierAverage
/
average
:
1.0
;
// this can only happen in perfect benchmark that reports only zeros
@override
String
toString
()
{
final
StringBuffer
buffer
=
StringBuffer
();
...
...
@@ -640,6 +655,7 @@ class TimeseriesStats {
'
${samples.length}
total)'
);
buffer
.
writeln
(
' | average:
$average
μs'
);
buffer
.
writeln
(
' | outlier average:
$outlierAverage
μs'
);
buffer
.
writeln
(
' | outlier/clean ratio:
${outlierRatio}
x'
);
buffer
.
writeln
(
' | noise:
${_ratioToPercent(noise)}
'
);
return
buffer
.
toString
();
}
...
...
@@ -730,6 +746,7 @@ class Profile {
final
TimeseriesStats
stats
=
timeseries
.
computeStats
();
json
[
'
$key
.average'
]
=
stats
.
average
;
json
[
'
$key
.outlierAverage'
]
=
stats
.
outlierAverage
;
json
[
'
$key
.outlierRatio'
]
=
stats
.
outlierRatio
;
json
[
'
$key
.noise'
]
=
stats
.
noise
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment