Commit 1250f6ad authored by Scott Violet's avatar Scott Violet Committed by V8 LUCI CQ

Adds counter for snapshot decompression time

I'm in the process of evaluating impact of v8 snapshot and
would like to understand the amount of time spend decompressing.

BUG=chromium:1257321
TEST=none

Change-Id: I122a2151e48f61db3352da56763e3e66f7415efe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3256006
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77661}
parent 5151cee9
......@@ -130,7 +130,9 @@ namespace internal {
HT(compile_script, V8.CompileScriptMicroSeconds, 1000000, MICROSECOND) \
/* Time for lazily compiling Wasm functions. */ \
HT(wasm_lazy_compile_time, V8.WasmLazyCompileTimeMicroSeconds, 100000000, \
MICROSECOND)
MICROSECOND) \
/* Total time to decompress snapshots. */ \
HT(snapshot_decompress, V8.SnapshotDecompress, 10000000, MICROSECOND)
#define NESTED_TIMED_HISTOGRAM_LIST_SLOW(HT) \
/* Total V8 time (including JS and runtime calls, exluding callbacks) */ \
......
......@@ -7,10 +7,6 @@
#include "src/common/assert-scope.h"
#include "src/snapshot/serializer.h"
#ifdef V8_SNAPSHOT_COMPRESSION
#include "src/snapshot/snapshot-compression.h"
#endif
namespace v8 {
namespace internal {
......
......@@ -11,6 +11,7 @@
#include "src/execution/isolate-inl.h"
#include "src/heap/safepoint.h"
#include "src/init/bootstrapper.h"
#include "src/logging/counters-scopes.h"
#include "src/logging/runtime-call-stats-scope.h"
#include "src/objects/code-kind.h"
#include "src/objects/js-regexp-inl.h"
......@@ -173,9 +174,18 @@ bool Snapshot::Initialize(Isolate* isolate) {
base::Vector<const byte> shared_heap_data =
SnapshotImpl::ExtractSharedHeapData(blob);
#ifdef V8_SNAPSHOT_COMPRESSION
base::Optional<NestedTimedHistogramScope> decompress_histogram;
if (base::TimeTicks::IsHighResolution()) {
decompress_histogram.emplace(isolate->counters()->snapshot_decompress());
}
#endif
SnapshotData startup_snapshot_data(MaybeDecompress(startup_data));
SnapshotData read_only_snapshot_data(MaybeDecompress(read_only_data));
SnapshotData shared_heap_snapshot_data(MaybeDecompress(shared_heap_data));
#ifdef V8_SNAPSHOT_COMPRESSION
decompress_histogram.reset();
#endif
bool success = isolate->InitWithSnapshot(
&startup_snapshot_data, &read_only_snapshot_data,
......
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