This CL does not yet roll `package:ffi` to use `Allocator`, because that
breaks the checked in Dart in Flutter in g3. Instead, this copies
`_CallocAllocator` from `package:ffi` into the benchmarks. (We need a
copy per benchmark such that file-copying before running benchmarks
works properly.) The copies can be deleted when we can update
`package:ffi` in the DEPS file to contain `_CallocAllocator`.
New API landed in: https://dart-review.googlesource.com/c/sdk/+/177705
Issue: https://github.com/dart-lang/sdk/issues/44621
Issue: https://github.com/dart-lang/sdk/issues/38721
Change-Id: I546de7ec65ceb6f05644a5f269b83f64656892e5
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178995
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
- Generate strings on one place rather than work hard to generate them
the same with different number types.
- Update dart2 version
Change-Id: I69e6bde8b870598e062b5009578e5f8c7b2a6add
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176585
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This reverts commit 7ebbc89e78.
The benchmark became broken because it checks for round-trip fidelity
and using a shared list of strings there is rounding on the int.*.64
case.
I'll fix it and recommit.
TBR: whesse@google.com
Change-Id: I9ba25716992e59929726745b9414eb8dc17a55fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176580
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
- Generate strings on one place rather than work hard to generate them
the same with different number types.
- Update dart2 version
Change-Id: I449d08a5ead13504ec604b11bd63b729590d6ffe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175861
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
A benchmark that is a collection of other benchmarks.
This benchmark has two purposes:
- As a medium sized compilation benchmark
- As a tool for running benchmarks as part of a larger program
This benchmark is not intended to be run for the purpose of generating
benchmark timing results on Golem.
It should be extended over time to include most public benchmarks that
are meaningful on all Dart platforms.
Change-Id: I17f034cfd68d01ff5b4842b89b216fcea0d5bd3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170060
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: William Hesse <whesse@google.com>
The existing EventLoopLatencyJson benchmark exercises the *worst case scenario*:
A background isolate is stressing the GC where the working memory set
does not fit into new space. This causes scavenges to copy the entire
newspace either into the to-space or promote it to old space.
The benchmark in this CL is similar to EventLoopLatencyJson, but it's working
memory set is significantly lower than new space, therefore not
exercising this worst case scenario (this represents the most common
scenario, which we would expect for compute() function in flutter)
(Due to difficulty sharing code between benchmarks, this CL adds
similar code as EventLoopLatencyJson)
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I385a620ba8900082f8ca5fb9080fc23d95112e83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169100
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This CL adds Utf8 encode benchmarks to complement the existing Utf8
decode benchmarks. These benchmarks measure the time to process a
given input rune.
The motivation for adding this was after noticing in external
benchmarks that Dart utf8 encoding can sometimes be much slower
than the utf8 encoding in other languages. After adding benchmarks,
I plan to send CLs for some small tweaks that may improve performance.
Change-Id: I8751d7df22937e9a85b85794e3488c664c359bbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158820
Auto-Submit: Benjamin Prosnitz <bprosnitz@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Dart 2 version of this benchmark doesn't have this call.
Dart 3 (NNBD) is more strict and allows implicit casts only if casting
from dynamic, so it highlights places where types are incompatible.
However, Iterable.cast<int>() has a high overhead and it doesn't look
like a right way to suppress static type check in this case, as it
creates a new Iterable which would additionally cast each element.
Simple 'input as dynamic' cast is enough in this case and reflects
what was happening in Dart 2 case when types are incompatible.
Fixes https://github.com/dart-lang/sdk/issues/42506
Change-Id: I8d83796a53b53e6f567f533f3d5369cd29f6ad97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152700
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: William Hesse <whesse@google.com>
The literal_only_boolean_expressions analyzer hint flags this code:
while (true) {
...
if (cond) break;
...
}
=> This is very common code.
The unnecessary_await_in_return analyzer hint flags this code:
Future foo() async {
...
return await foo();
}
=> Addressing this hint by removing the `await` changes semantics,
performance characteristics and async stack traces.
Change-Id: I3c126123bfba7386b01033084e954267af21ba13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152001
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Hoist 'one' in all versions of benchmark for uniformity.
Change-Id: Id2aaa9b18903ff33e3057c01e13ff332fc8979ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151180
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
This hint flags code such as
int time = watch.elapsedMillisecond;
and encourages using `var` everywhere:
var time = watch.elapsedMillisecond;
Though if the type is not obvious to a developer, we should be allowed
to write it.
Furthermore it copies the rules from
`package:pedantic/analysis_options-1.9.0.yaml` to avoid being
automatically opted-in to new rules when a new package:pedantic
gets rolled into the SDK.
Change-Id: I45c72584885c608a56745685e9068ba83dfbed47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151526
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
On x64 desktop in JIT the trampolines with Handles are a bit slower
than trampolines passing integers or Pointers.
FfiCall.Uint64x01(RunTime): 200.8482627033541 us.
FfiCall.PointerUint8x01(RunTime): 261.3910088865656 us.
FfiCall.Handlex01(RunTime): 355.4978670458585 us.
FfiCall.Handlex02(RunTime): 384.86376755820663 us.
FfiCall.Handlex04(RunTime): 492.896007885658 us.
FfiCall.Handlex10(RunTime): 846.1214043993232 us.
FfiCall.Handlex20(RunTime): 1193.412291169451 us.
Issue: https://github.com/dart-lang/sdk/issues/36858
Issue: https://github.com/dart-lang/sdk/issues/41319
New issue for optimizing multiple handles:
https://github.com/dart-lang/sdk/issues/42341
Also cleans up dart2/native which was erroneously left over from the
benchmark duplication for NNBD.
Change-Id: I81223fefc47129d00984492efb9502d5449f0d4a
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145593
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Also:
* Clean up lints in both unmigrated and migrated versions of benchmarks.
* Cache lists in local variables in Uint8ListCopyViaLoopBenchmark and
Float64ListCopyViaLoopBenchmark to make the same number of field
accesses as in other benchmarks, in order to make comparison between
different ways of copying typed data more fair.
Change-Id: I1e7e726ebf1f3cf6c199fce515c2a56d94576ba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150280
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The shared libraries for the FfiBoringssl benchmark had been moved up a
level but unfortunately the same change wasn't made for the FfiCall
benchmark.
The IsolateJson benchmark had a typo in the path and broke.
Change-Id: Iec2fec1d5508022d9cfbfb040d80c74b078a0640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150024
Reviewed-by: William Hesse <whesse@google.com>
This change actually migrates vm/dart/* tests to NNBD by fixing
compile-time errors and adjusting tests where needed.
vm/dart/null_float32x4_simd_ops_test and vm/dart/null_float64x2_simd_ops_test
are deleted as they are superseded by static type checks.
vm/dart/regress_40462_test.dart is a huge source code auto-generated
by fuzzer and migrating and maintaining this source doesn't have much
value, so it is deleted.
There are still failures in strong mode due to dependencies on
the packages which are not migrated yet (https://github.com/dart-lang/sdk/issues/42146).
Migrated vm/dart/null_checks_with_dwarf_stack_traces_test fails both in
weak and strong mode due to https://github.com/dart-lang/sdk/issues/42149.
Issue: https://github.com/dart-lang/sdk/issues/41314
Change-Id: I5561f1c8705ec16def0c4e0efa495d15f4ea7259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149493
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This change forks the benchmarks for the null safety feature where there
now is a null safe version at benchmarks/Foo/dart and a legacy Dart 2
version at benchmarks/Foo/dart2. This change allows benchmarks to be
migrated per go/dart-nnbd-benchmark-migration.
Additionally this change pins the internal benchmarks which have been
moved into their own repository and is now versioned along with the Dart
SDK.
The dart2 implementation will be benchmarked instead of the null safe
dart implementation as of this change. The null safe dart implementation
will be used when null safe benchmarking is turned on.
Change-Id: If039fd7100c960169f4161c1d98167aca0af2ded
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148440
Reviewed-by: Alexander Thomas <athom@google.com>
The Dart benchmarks will soon be forked for non-nullability and there
will be two implementations of the FfiBoringssl benchmark. This change
moves the native BoringSSL build a level up so it can be shared between
the two implementations, avoiding doubling the needed filesystem space.
Change-Id: I8bcc113e19715865f28bc1950cf07ba6cc7ea61f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148760
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
The majority of UTF-8 decoding in Dart programs is done via the
utf8.decode() call. Therefore, our benchmark should do the same to
better reflect realistic use.
Change-Id: I080edf689a8acd329bb2ee4d54a3de842f387a0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145594
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This is in preparation for upcoming optimizations to the UTF-8 decoding.
The data files are extracts from Wikipedia with markup stripped. They
cover 6 representative cases of typical input data:
- English text, only ASCII
- Danish text, mostly ASCII, only Latin-1
- Slovak text, mostly ASCII, not only Latin-1
- Russian text, max 2 bytes per character
- Nepali text, max 3 bytes per character
- Chinese text, full character range
Each of the languages are benchmarked with small (average 10 bytes),
medium (10 000 bytes) and large (10 000 000 bytes) inputs.
Only allowMalformed: false is benchmarked.
Change-Id: I72e6959c49388f2aebf33da0c582b7729be6297c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140870
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Ensure to count heap sizes of all isolate groups, since
AOT works with --enable-isolate-groups, JIT without.
Make the benchmark work in phases to make numbers more stable.
Add a max-process-rss metric to see peak memory during duration
of the entire benchmark.
Change-Id: I481b2cb8b666885b5c2b9c53fff1177accd01830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126724
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This is to reduce load on Android benchmarking hardware.
Change-Id: Ib51b3fbbe2bf66cb0ba17375062a747f37284299
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124600
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
These new benchmarks better measure rss delta associated with spawning new dart2js isolate.
Also this moves IsolateSpawn heap measurement benchmarks into this group as well because
they are effectively new benchmarks.
Change-Id: Idf31f83b24713932d5ddfa096e23f36ae8195cd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123685
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
To see advantage of running decoding on separate isolate this benchmark decodes 10 json strings.
Sync implementation has to do it sequentially, async version does in parallel.
Change-Id: Ia4e25f532d0a92aea9b16b99e374b898899a11cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123100
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This has coupled changes in package:ffi and package:tflite_native which are pinned in DEPS.
This CL includes the required analyzer changes from https://dart-review.googlesource.com/c/sdk/+/121647.
Issue: https://github.com/dart-lang/sdk/issues/38611
Change-Id: I712a886fd28ce0a2954fc42c90e1dfa495057732
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121422
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The benchmark spawns an isolate that compiles hello world app with dart2js, measures time it takes for spawned isolate to get up and running, measures delta rss when isolate is spawned.
This also adds analysis_options.yaml that helps with keeping the code lint-free.
Change-Id: I5f1ffa9706766cd00bf1ea3fdad76957952de8a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119538
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Also clean up test/benchmark/sample code using nullptr and fix pubspec.yaml in the SQLite sample.
Fixes https://github.com/dart-lang/sdk/issues/37362
Change-Id: I6fa0522374af28020ef8f096ac22b23712aedb5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121122
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
I used the regex replaces documented on the `load` and `store` deprecated methods.
I manually replaced some `.val` to `.ref` when a regex could not detect whether something was a primitive value or a struct.
Issue: https://github.com/dart-lang/sdk/issues/37773
Change-Id: I3534b6dd00d9ac45fa1a11fe75c80fb3cccc07dc
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118993
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This is to replace vm/transferabe_test 'benchmark' and introduce home for further isolate communication benchmarks.
Addresses https://github.com/dart-lang/sdk/issues/37520.
Change-Id: Ie425c4a855744fa0228271893dbd236b993d3ce2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114449
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Adds micro benchmarks to measure low level (1) C memory reads and writes from Dart and (2) calls from Dart into C. This CL also adds a macro benchmark to measure overall performance using BoringSSL to digest data. The shared libraries are precompiled for Linux and live in cipd packages. The benchmarks run on all hardware architectures (with the exception of Linux'es hardfp on Arm32: https://github.com/dart-lang/sdk/issues/36309).
Issue: https://github.com/dart-lang/sdk/issues/36247
Change-Id: I8dfb30cc66a26a2942bb09194c5eb0da0b6ca1b5
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108724
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Benchmarks are checked in as benchmarks/<Benchmark>/dart/<Benchmark>.dart.
This scheme is compatible with our existing benchmarking infrastructure
and will aid migrating the benchmarks with minimal breakage.
This change adds an Example benchmark to show how it is done.
The benchmarks directory is now added to the Dart benchmarking builds.
Change-Id: I25971ba3b219194fa9cfea6b938372d877477e28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108414
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>