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
1393c730
Unverified
Commit
1393c730
authored
Aug 01, 2018
by
Devon Carew
Committed by
GitHub
Aug 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the best of four results for flutter analyze --benchmark (#20058)
parent
d2ab29d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
analysis.dart
dev/devicelab/lib/tasks/analysis.dart
+6
-5
No files found.
dev/devicelab/lib/tasks/analysis.dart
View file @
1393c730
...
...
@@ -4,6 +4,7 @@
import
'dart:async'
;
import
'dart:io'
;
import
'dart:math'
as
math
;
import
'package:path/path.dart'
as
path
;
...
...
@@ -11,7 +12,7 @@ import '../framework/framework.dart';
import
'../framework/utils.dart'
;
/// Run each benchmark this many times and compute average.
const
int
_kRunsPerBenchmark
=
3
;
const
int
_kRunsPerBenchmark
=
4
;
/// Runs a benchmark once and reports the result as a lower-is-better numeric
/// value.
...
...
@@ -90,13 +91,13 @@ class _MegaGalleryBenchmark {
/// Runs a [benchmark] several times and reports the average result.
Future
<
double
>
_run
(
_Benchmark
benchmark
)
async
{
double
total
=
0.0
;
double
best
;
for
(
int
i
=
0
;
i
<
_kRunsPerBenchmark
;
i
++)
{
// Delete cached analysis results.
rmTree
(
dir
(
'
${Platform.environment['HOME']}
/.dartServer'
));
total
+=
await
benchmark
();
final
double
result
=
await
benchmark
();
best
=
math
.
min
(
result
,
best
??
result
);
}
final
double
average
=
total
/
_kRunsPerBenchmark
;
return
average
;
return
best
;
}
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