Commit 24151a91 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Fix lazy compilation throughput counter

Instead of reporting kB/s as documented, we were computing bytes/us,
i.e. MB/s, hence mostly reporting 0.
This CL fixes this and renames the variables to make the units more
obvious.

R=titzer@chromium.org

Bug: v8:8975
Change-Id: I0177a8631cc600ab1369657318944f9a215486ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1543351Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60509}
parent 9474b540
......@@ -336,15 +336,13 @@ void CompileLazy(Isolate* isolate, NativeModule* native_module,
if (WasmCode::ShouldBeLogged(isolate)) code->LogCode(isolate);
int64_t func_size =
static_cast<int64_t>(func->code.end_offset() - func->code.offset());
int64_t compilation_time = compilation_timer.Elapsed().InMicroseconds();
double func_kb = 1e-3 * func->code.length();
double compilation_seconds = compilation_timer.Elapsed().InSecondsF();
counters->wasm_lazily_compiled_functions()->Increment();
counters->wasm_lazy_compilation_throughput()->AddSample(
compilation_time != 0 ? static_cast<int>(func_size / compilation_time)
: 0);
int throughput_sample = static_cast<int>(func_kb / compilation_seconds);
counters->wasm_lazy_compilation_throughput()->AddSample(throughput_sample);
}
namespace {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment