Commit 705a50a3 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[snapshot] add timers to no-snapshot code path.

This is to compare the the no-snapshot build to the
snapshot build when creating an isolate or context.

R=jgruber@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I503cde560b7897b945b3f9d2b445d0abcbfb5b60
Reviewed-on: https://chromium-review.googlesource.com/571744Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46674}
parent 7f50476b
......@@ -8470,7 +8470,13 @@ Isolate* IsolateNewImpl(internal::Isolate* isolate,
// TODO(jochen): Once we got rid of Isolate::Current(), we can remove this.
Isolate::Scope isolate_scope(v8_isolate);
if (params.entry_hook || !i::Snapshot::Initialize(isolate)) {
base::ElapsedTimer timer;
if (i::FLAG_profile_deserialization) timer.Start();
isolate->Init(NULL);
if (i::FLAG_profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF();
i::PrintF("[Initializing isolate from scratch took %0.3f ms]\n", ms);
}
}
return v8_isolate;
}
......
......@@ -5154,6 +5154,8 @@ Genesis::Genesis(
}
DCHECK(!global_proxy->IsDetachedFrom(native_context()->global_object()));
} else {
base::ElapsedTimer timer;
if (FLAG_profile_deserialization) timer.Start();
DCHECK_EQ(0u, context_snapshot_index);
// We get here if there was no context snapshot.
CreateRoots();
......@@ -5174,6 +5176,11 @@ Genesis::Genesis(
if (!ConfigureGlobalObjects(global_proxy_template)) return;
isolate->counters()->contexts_created_from_scratch()->Increment();
if (FLAG_profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF();
i::PrintF("[Initializing context from scratch took %0.3f ms]\n", ms);
}
}
// Install experimental natives. Do not include them into the
......
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