Commit 581355be authored by Scott Violet's avatar Scott Violet Committed by V8 LUCI CQ

Adds counter for snapshot decompress time when creating context

BUG=chromium:1257321
TEST=none

Change-Id: I59f34e8b41ba08f5046754c13be8f1df6a335655
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3271389Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77824}
parent 937d44e9
...@@ -131,8 +131,11 @@ namespace internal { ...@@ -131,8 +131,11 @@ namespace internal {
/* Time for lazily compiling Wasm functions. */ \ /* Time for lazily compiling Wasm functions. */ \
HT(wasm_lazy_compile_time, V8.WasmLazyCompileTimeMicroSeconds, 100000000, \ HT(wasm_lazy_compile_time, V8.WasmLazyCompileTimeMicroSeconds, 100000000, \
MICROSECOND) \ MICROSECOND) \
/* Total time to decompress snapshots. */ \ /* Total time to decompress isolate snapshot. */ \
HT(snapshot_decompress, V8.SnapshotDecompress, 10000000, MICROSECOND) HT(snapshot_decompress, V8.SnapshotDecompress, 10000000, MICROSECOND) \
/* Time to decompress context snapshot. */ \
HT(context_snapshot_decompress, V8.ContextSnapshotDecompress, 10000000, \
MICROSECOND)
#define NESTED_TIMED_HISTOGRAM_LIST_SLOW(HT) \ #define NESTED_TIMED_HISTOGRAM_LIST_SLOW(HT) \
/* Total V8 time (including JS and runtime calls, exluding callbacks) */ \ /* Total V8 time (including JS and runtime calls, exluding callbacks) */ \
......
...@@ -210,10 +210,20 @@ MaybeHandle<Context> Snapshot::NewContextFromSnapshot( ...@@ -210,10 +210,20 @@ MaybeHandle<Context> Snapshot::NewContextFromSnapshot(
bool can_rehash = ExtractRehashability(blob); bool can_rehash = ExtractRehashability(blob);
base::Vector<const byte> context_data = SnapshotImpl::ExtractContextData( base::Vector<const byte> context_data = SnapshotImpl::ExtractContextData(
blob, static_cast<uint32_t>(context_index)); blob, static_cast<uint32_t>(context_index));
SnapshotData snapshot_data(MaybeDecompress(context_data)); base::Optional<SnapshotData> snapshot_data;
{
#ifdef V8_SNAPSHOT_COMPRESSION
base::Optional<NestedTimedHistogramScope> decompress_histogram;
if (base::TimeTicks::IsHighResolution()) {
decompress_histogram.emplace(
isolate->counters()->context_snapshot_decompress());
}
#endif
snapshot_data.emplace(MaybeDecompress(context_data));
}
MaybeHandle<Context> maybe_result = ContextDeserializer::DeserializeContext( MaybeHandle<Context> maybe_result = ContextDeserializer::DeserializeContext(
isolate, &snapshot_data, can_rehash, global_proxy, isolate, &(*snapshot_data), can_rehash, global_proxy,
embedder_fields_deserializer); embedder_fields_deserializer);
Handle<Context> result; Handle<Context> result;
......
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