From bf97e28b6d3dfc37fbc4f8951f8a2d75ddb7c913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20A=C4=9Facan?= Date: Wed, 25 Jun 2025 06:49:29 -0700 Subject: [PATCH] [dart2wasm] Fix reporting measurements in WasmJSInterop benchmarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit benchmark_harness's `measureFor` returns in microseconds, but we currently show the numbers with the unit "ns". Convert the microseconds reported by benchmark_harness to nanoseconds when reporting. We could also report in microseconds, but the numbers would be very small, with a few zeros before fractional digits. So keep reporting in nanoseconds. Change-Id: I189190b2139c8e2d39b8bef84159585ab0967980 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436904 Commit-Queue: Ömer Ağacan Reviewed-by: Martin Kustermann --- benchmarks/WasmJSInterop/dart/WasmJSInterop.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/WasmJSInterop/dart/WasmJSInterop.dart b/benchmarks/WasmJSInterop/dart/WasmJSInterop.dart index 201a63a6e05..03d30ee4a07 100644 --- a/benchmarks/WasmJSInterop/dart/WasmJSInterop.dart +++ b/benchmarks/WasmJSInterop/dart/WasmJSInterop.dart @@ -341,6 +341,6 @@ void main() { } /// Reports in Golem-specific format. -void report(String name, double nsPerCall) { - print('$name(RunTimeRaw): $nsPerCall ns.'); +void report(String name, double usPerCall) { + print('$name(RunTimeRaw): ${usPerCall * 1000} ns.'); }