From a0f71d4f6b353e6b9599fe77e805696271ee4c9e Mon Sep 17 00:00:00 2001 From: Jens Johansen Date: Tue, 20 Jun 2023 06:07:48 +0000 Subject: [PATCH] [analyzer] Make benchmark report memory usage in bytes to make golem happy Initial commit at https://dart-review.googlesource.com/c/sdk/+/276100 used kb because that's what was reported by the system. I wasn't allowed to add that to golem though, and then I forgot about it. This CL changes it to bytes so it can hopefully by allowed into golem. Change-Id: Ia7fae9ed47e6d237648e266c26f4a644f13571d3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310160 Reviewed-by: Brian Wilkerson Reviewed-by: Konstantin Shcheglov Commit-Queue: Jens Johansen --- pkg/analysis_server/benchmark/benchmarks.dart | 2 +- pkg/analysis_server/benchmark/perf/dart_analyze.dart | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/analysis_server/benchmark/benchmarks.dart b/pkg/analysis_server/benchmark/benchmarks.dart index fe4d21b3b95..c9652d97dd3 100644 --- a/pkg/analysis_server/benchmark/benchmarks.dart +++ b/pkg/analysis_server/benchmark/benchmarks.dart @@ -95,7 +95,7 @@ abstract class Benchmark { } class BenchMarkResult { - /// One of 'bytes', 'kb', 'micros', or 'compound'. + /// One of 'bytes', 'micros', or 'compound'. final String kindName; final int value; diff --git a/pkg/analysis_server/benchmark/perf/dart_analyze.dart b/pkg/analysis_server/benchmark/perf/dart_analyze.dart index 1265ed801e1..292ead7014f 100644 --- a/pkg/analysis_server/benchmark/perf/dart_analyze.dart +++ b/pkg/analysis_server/benchmark/perf/dart_analyze.dart @@ -78,7 +78,7 @@ abstract class AbstractCmdLineBenchmark extends Benchmark { stdout: stdout, ); int kbNoCache = jsonDecode(stdout[1])["memory"] as int; - result.add('no-cache-memory', BenchMarkResult('kb', kbNoCache)); + result.add('no-cache-memory', BenchMarkResult('bytes', kbNoCache * 1024)); stdout = []; await runProcess( @@ -96,7 +96,8 @@ abstract class AbstractCmdLineBenchmark extends Benchmark { stdout: stdout, ); int kbWithCache = jsonDecode(stdout[1])["memory"] as int; - result.add('with-cache-memory', BenchMarkResult('kb', kbWithCache)); + result.add( + 'with-cache-memory', BenchMarkResult('bytes', kbWithCache * 1024)); } cleanup();