mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:28:02 +00:00
[benchmarks] Add more test cases to ListCopy benchmarks.
This is the follow-up for the discussion on https://dart-review.googlesource.com/c/sdk/+/152700 Change-Id: Ifeeafcdc312c4f7df7e0be1cc806b972b8c18078 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152709 Reviewed-by: Stephen Adams <sra@google.com> Reviewed-by: Jonas Termansen <sortie@google.com> Auto-Submit: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
parent
8cc3d415e7
commit
9ae1448ef0
2 changed files with 18 additions and 0 deletions
|
@ -133,6 +133,15 @@ List<Benchmark> makeBenchmarks(int length) => [
|
|||
Benchmark('spread.int', length, () {
|
||||
output = <int>[...input as dynamic];
|
||||
}),
|
||||
Benchmark('spread.int.cast', length, () {
|
||||
output = <int>[...input.cast<int>()];
|
||||
}),
|
||||
Benchmark('spread.int.map', length, () {
|
||||
output = <int>[...input.map((x) => x as int)];
|
||||
}),
|
||||
Benchmark('for.int', length, () {
|
||||
output = <int>[for (var n in input) n as int];
|
||||
}),
|
||||
];
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -133,6 +133,15 @@ List<Benchmark> makeBenchmarks(int length) => [
|
|||
Benchmark('spread.int', length, () {
|
||||
output = <int>[...input];
|
||||
}),
|
||||
Benchmark('spread.int.cast', length, () {
|
||||
output = <int>[...input.cast<int>()];
|
||||
}),
|
||||
Benchmark('spread.int.map', length, () {
|
||||
output = <int>[...input.map((x) => x as int)];
|
||||
}),
|
||||
Benchmark('for.int', length, () {
|
||||
output = <int>[for (var n in input) n as int];
|
||||
}),
|
||||
];
|
||||
|
||||
void main() {
|
||||
|
|
Loading…
Reference in a new issue