Commit 612cb2cb authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

[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/+/1754721Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63252}
parent 5d4ca7ba
......@@ -188,6 +188,8 @@ namespace internal {
V8.WasmCompileModuleAsyncMicroSeconds, 100000000, MICROSECOND) \
HT(wasm_streaming_compile_wasm_module_time, \
V8.WasmCompileModuleStreamingMicroSeconds, 100000000, MICROSECOND) \
HT(wasm_streaming_deserialize_wasm_module_time, \
V8.WasmDeserializeModuleStreamingMicroSeconds, 100000000, MICROSECOND) \
HT(wasm_tier_up_module_time, V8.WasmTierUpModuleMicroSeconds, 100000000, \
MICROSECOND) \
HT(wasm_compile_asm_function_time, V8.WasmCompileFunctionMicroSeconds.asm, \
......
......@@ -1460,6 +1460,7 @@ class AsyncStreamingProcessor final : public StreamingProcessor {
AsyncCompileJob* job_;
WasmEngine* wasm_engine_;
std::unique_ptr<CompilationUnitBuilder> compilation_unit_builder_;
base::TimeTicks start_time_;
int num_functions_ = 0;
};
......@@ -1958,7 +1959,8 @@ AsyncStreamingProcessor::AsyncStreamingProcessor(AsyncCompileJob* job)
: decoder_(job->enabled_features_),
job_(job),
wasm_engine_(job_->isolate_->wasm_engine()),
compilation_unit_builder_(nullptr) {}
compilation_unit_builder_(nullptr),
start_time_(base::TimeTicks::Now()) {}
void AsyncStreamingProcessor::FinishAsyncCompileJobWithError(
const WasmError& error) {
......@@ -2187,6 +2189,13 @@ bool AsyncStreamingProcessor::Deserialize(Vector<const uint8_t> module_bytes,
MaybeHandle<WasmModuleObject> result =
DeserializeNativeModule(job_->isolate_, module_bytes, wire_bytes);
if (base::TimeTicks::IsHighResolution()) {
base::TimeDelta duration = base::TimeTicks::Now() - start_time_;
auto* histogram = job_->isolate_->counters()
->wasm_streaming_deserialize_wasm_module_time();
histogram->AddSample(static_cast<int>(duration.InMicroseconds()));
}
if (result.is_null()) return false;
job_->module_object_ =
......
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