[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 <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This commit is contained in:
Jens Johansen 2023-06-20 06:07:48 +00:00 committed by Commit Queue
parent 62f66ecef4
commit a0f71d4f6b
2 changed files with 4 additions and 3 deletions

View file

@ -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;

View file

@ -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();