Skip to content

Commit 612cb2c

Browse files
Bill BudgeCommit Bot
authored andcommitted
[wasm] Add histogram for streaming deserialization (from cache)
- Adds a histogram to measure time between streaming start and deserialization finished. Bug: chromium:719172 Change-Id: Ib4ce24bee05a0db7e1bbf50d3bf456af89dbd2a6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1754721 Reviewed-by: Andreas Haas <ahaas@chromium.org> Commit-Queue: Bill Budge <bbudge@chromium.org> Cr-Commit-Position: refs/heads/master@{#63252}
1 parent 5d4ca7b commit 612cb2c

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/logging/counters-definitions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ namespace internal {
188188
V8.WasmCompileModuleAsyncMicroSeconds, 100000000, MICROSECOND) \
189189
HT(wasm_streaming_compile_wasm_module_time, \
190190
V8.WasmCompileModuleStreamingMicroSeconds, 100000000, MICROSECOND) \
191+
HT(wasm_streaming_deserialize_wasm_module_time, \
192+
V8.WasmDeserializeModuleStreamingMicroSeconds, 100000000, MICROSECOND) \
191193
HT(wasm_tier_up_module_time, V8.WasmTierUpModuleMicroSeconds, 100000000, \
192194
MICROSECOND) \
193195
HT(wasm_compile_asm_function_time, V8.WasmCompileFunctionMicroSeconds.asm, \

src/wasm/module-compiler.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,7 @@ class AsyncStreamingProcessor final : public StreamingProcessor {
14601460
AsyncCompileJob* job_;
14611461
WasmEngine* wasm_engine_;
14621462
std::unique_ptr<CompilationUnitBuilder> compilation_unit_builder_;
1463+
base::TimeTicks start_time_;
14631464
int num_functions_ = 0;
14641465
};
14651466

@@ -1958,7 +1959,8 @@ AsyncStreamingProcessor::AsyncStreamingProcessor(AsyncCompileJob* job)
19581959
: decoder_(job->enabled_features_),
19591960
job_(job),
19601961
wasm_engine_(job_->isolate_->wasm_engine()),
1961-
compilation_unit_builder_(nullptr) {}
1962+
compilation_unit_builder_(nullptr),
1963+
start_time_(base::TimeTicks::Now()) {}
19621964

19631965
void AsyncStreamingProcessor::FinishAsyncCompileJobWithError(
19641966
const WasmError& error) {
@@ -2187,6 +2189,13 @@ bool AsyncStreamingProcessor::Deserialize(Vector<const uint8_t> module_bytes,
21872189

21882190
MaybeHandle<WasmModuleObject> result =
21892191
DeserializeNativeModule(job_->isolate_, module_bytes, wire_bytes);
2192+
if (base::TimeTicks::IsHighResolution()) {
2193+
base::TimeDelta duration = base::TimeTicks::Now() - start_time_;
2194+
auto* histogram = job_->isolate_->counters()
2195+
->wasm_streaming_deserialize_wasm_module_time();
2196+
histogram->AddSample(static_cast<int>(duration.InMicroseconds()));
2197+
}
2198+
21902199
if (result.is_null()) return false;
21912200

21922201
job_->module_object_ =

0 commit comments

Comments
 (0)