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
a7790d8e
Unverified
Commit
a7790d8e
authored
Feb 22, 2022
by
gaaclarke
Committed by
GitHub
Feb 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a microbenchmark for Timeline events. (#98763)
parent
79d435d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
timeline_bench.dart
...hmarks/microbenchmarks/lib/foundation/timeline_bench.dart
+53
-0
microbenchmarks.dart
dev/devicelab/lib/tasks/microbenchmarks.dart
+1
-0
No files found.
dev/benchmarks/microbenchmarks/lib/foundation/timeline_bench.dart
0 → 100644
View file @
a7790d8e
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:developer'
;
import
'../common.dart'
;
const
int
_kNumIterations
=
10000
;
void
main
(
)
{
assert
(
false
,
"Don't run benchmarks in checked mode! Use 'flutter run --release'."
);
final
BenchmarkResultPrinter
printer
=
BenchmarkResultPrinter
();
final
Stopwatch
watch
=
Stopwatch
();
watch
.
start
();
for
(
int
i
=
0
;
i
<
_kNumIterations
;
i
+=
1
)
{
Timeline
.
startSync
(
'foo'
);
Timeline
.
finishSync
();
}
watch
.
stop
();
printer
.
addResult
(
description:
'timeline events without arguments'
,
value:
watch
.
elapsedMicroseconds
.
toDouble
()
/
_kNumIterations
,
unit:
'us per iteration'
,
name:
'timeline_without_arguments'
,
);
watch
.
reset
();
watch
.
start
();
for
(
int
i
=
0
;
i
<
_kNumIterations
;
i
+=
1
)
{
Timeline
.
startSync
(
'foo'
,
arguments:
<
String
,
dynamic
>{
'int'
:
1234
,
'double'
:
0.3
,
'list'
:
<
int
>[
1
,
2
,
3
,
4
],
'map'
:
<
String
,
dynamic
>{
'map'
:
true
},
'bool'
:
false
,
});
Timeline
.
finishSync
();
}
watch
.
stop
();
printer
.
addResult
(
description:
'timeline events with arguments'
,
value:
watch
.
elapsedMicroseconds
.
toDouble
()
/
_kNumIterations
,
unit:
'us per iteration'
,
name:
'timeline_with_arguments'
,
);
printer
.
printToStdout
();
}
dev/devicelab/lib/tasks/microbenchmarks.dart
View file @
a7790d8e
...
@@ -60,6 +60,7 @@ TaskFunction createMicrobenchmarkTask() {
...
@@ -60,6 +60,7 @@ TaskFunction createMicrobenchmarkTask() {
...
await
_runMicrobench
(
'lib/language/sync_star_semantics_bench.dart'
),
...
await
_runMicrobench
(
'lib/language/sync_star_semantics_bench.dart'
),
...
await
_runMicrobench
(
'lib/foundation/all_elements_bench.dart'
),
...
await
_runMicrobench
(
'lib/foundation/all_elements_bench.dart'
),
...
await
_runMicrobench
(
'lib/foundation/change_notifier_bench.dart'
),
...
await
_runMicrobench
(
'lib/foundation/change_notifier_bench.dart'
),
...
await
_runMicrobench
(
'lib/foundation/timeline_bench.dart'
),
};
};
return
TaskResult
.
success
(
allResults
,
return
TaskResult
.
success
(
allResults
,
...
...
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