This is follow-up to 455a105c42
Change-Id: I346e0174dacad4fcae5285b63f77fe217543f7b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211040
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Clone latency.dart into the benchmark from EventLoopLatencyJson
Change-Id: I92090b4decf49e67b937d8095bb7c36adf79c509
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210430
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Compress the dart-sdk directory under the root, not the grandparent of
the root which will be the SDK checkout.
Also fix so dart2 version is 2.9 compatible and dart version is
latest version compatible.
Change-Id: I6e8875d9a3c9fdabf301db379340b2d8473a54cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210440
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
In AOT the SendPort.{Send,Receive}.BinaryTree.* are really fast, because
the tree shaker will remove the fields, which will make us actually not
construct a tree at all but only one root node without fields.
TEST=Changes benchmark to work as intended
Change-Id: Idbcb1e15613b1fd071591be40c4ffd9eadc86ce5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207121
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Other existing benchmarks that are related (e.g. IsolateJson) measure
multiple things at the same time (e.g. utf8 decoding speed, json
decoding speed, isolate communication).
The benchmarks in this CL focus purely on sending object graphs via [SendPort]s
and measure sending and receiving time. As data we measure json
(map/list/string heavy) as well as binary trees (user object heavy).
Issue https://github.com/dart-lang/sdk/issues/36097
TEST=Adding benchmark.
Change-Id: I032b5c63ee386697610ea2873914109789e00137
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203763
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
startup time
Change-Id: If0c792036ac377aa3d777f95816e9d1d548326b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201167
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This CL adds FFI leaf calls by adding `lookupFunction(.., isLeaf)`
and `_asFunctionInternal(.., isLeaf)`, which generate FFI leaf calls.
These calls skip a lot of the usual frame building and generated <->
native transition overhead.
`benchmark/FfiCall/` shows a 1.1x - 4.3x speed-up between the regular
FFI calls and their leaf call counterparts (JIT, x64, release).
TEST=Adds `tests/ffi{,_2}/vmspecific_leaf_call_test.dart`. Tested FFI tests.
Closes: https://github.com/dart-lang/sdk/issues/36707
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-release-arm64-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-precomp-nnbd-mac-release-simarm64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Bug: https://github.com/dart-lang/sdk/issues/36707
Change-Id: Id8824f36b0006bf09951207bd004356fe6e9f46e
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179768
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL validates the hypothesis that the only misaligned reads/writes
which are not supported are double and float, and only on arm32.
Running these on the CI and Golem will validate this hypothesis.
Bug: https://github.com/dart-lang/sdk/issues/45009
Change-Id: I0a77fd1f47a388d1f454c1ded50cd7ecaeadb0f0
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190523
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Inlines in the test classes:
- Native function lookup.
- The main benchmark loop.
This CL contains the refactoring necessary to update the
benchmarks to include leaf calls, as seen in:
https://dart-review.googlesource.com/c/sdk/+/179768
TEST=tools/build.py -m release dart && out/ReleaseX64/dart benchmarks/FfiCall/dart{,2}/FfiCall.dart
Change-Id: I1e85f991d895862c27ae99a71f5d4785ccdf5676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188465
Commit-Queue: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Adds benchmarks using `asTypedList` on Pointers to investigate from
where it pays of to do construct a TypedData to do memory access
instead of on the Pointer directly.
x64 JIT results:
- Memory access on TypedData (int8) is ~2,5 faster than on Pointer.
FfiMemory.PointerInt8(RunTime): 72.23885718413639 us.
FfiMemory.PointerInt8TypedDataReuse(RunTime): 28.239710263614928 us.
- Constructing the TypedData for 1000 reads + 1000 writes takes ~20%
of the total runtime, 400 reads or writes on TypedData, 160 reads
or writes on Pointer.
FfiMemory.PointerInt8TypedDataNew(RunTime): 34.345480148372026 us.
FfiMemory.PointerInt8TypedDataReuse(RunTime): 28.239710263614928 us.
x64 AOT results:
FfiMemory.PointerInt8(RunTime): 13.862134213116345 us.
FfiMemory.PointerInt8TypedDataNew(RunTime): 26.149628021913365 us.
FfiMemory.PointerInt8TypedDataReuse(RunTime): 24.73322780505299 us.
- Using asTypedList is slower. (Some optimizations fail to kick in.)
Change-Id: I401edb88baf3a3c5094ecae808f122adf258da28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186289
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
- Fixes expect logic in Float.. and Double.. benchmarks.
- Fixes expected values in the same benchmarks.
- Fixes typos in a few FFI function lookups.
- Adds expected value to 'Unexpected result' message.
Change-Id: I16eff1cac451412b376f56c070c5b8127ff744e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186284
Auto-Submit: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
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>