Commit graph

2 commits

Author SHA1 Message Date
Eric Seidel 4c20cedd30 Fix analysis issues in benchmarks/ directory
Now that I'm able to open the entire SDK in VSC, I'm fixing some
of the analysis issues in various files (carefully) without changing
their meaning.

In this case, I removed unnecessary imports from benchmarks.
In regexp_benchmark I ignored one warning which likely would
have changed the behavior of the code.

BUG=https://github.com/dart-lang/sdk/issues/52419

Change-Id: I9a195a4e45121313bd9f065f2579a165c3fec05b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303901
Auto-Submit: Eric Seidel <eric@shorebird.dev>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-05-17 09:14:50 +00:00
Clement Skau 36652d3b1a [benchmark] Adds native call benchmark.
Adds new benchmarks for native calls, parallel to the
existing benchmark for FFI calls.

This makes it possible (with some caveats) to compare
overheads of calling through native and FFI.

Local results on Linux, x64, AOT (for reference):

NativeCall.Uint8x01(RunTime): 585.9797891036907 us.
NativeCall.Int64x20(RunTime): 1340.2451440053583 us.
NativeCall.Doublex01(RunTime): 694.4875 us.
NativeCall.Doublex20(RunTime): 1610.102172164119 us.
NativeCall.Handlex01(RunTime): 735.7863184994483 us.
NativeCall.Handlex20(RunTime): 836.6783772480134 us.

FfiCall.Uint8x01(RunTime): 202.5837131570951 us.
FfiCall.Int64x20(RunTime): 328.16931911402787 us.
FfiCall.Doublex01(RunTime): 220.58028231142478 us.
FfiCall.Doublex20(RunTime): 373.4350261389096 us.
FfiCall.Handlex01(RunTime): 357.4213724088635 us.
FfiCall.Handlex20(RunTime): 1152.427995391705 us.

TEST=Manually ran benchmark locally.
Change-Id: Ib28455fbd9f739c1e3ba487b932b464fc12b7e04
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218920
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-11-04 15:16:24 +00:00