Add histogram timers for (de-)serialization during compilation.

R=yangguo@chromium.org
BUG=

Review URL: https://codereview.chromium.org/578263004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24127 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ddb2d266
...@@ -1170,6 +1170,7 @@ Handle<SharedFunctionInfo> Compiler::CompileScript( ...@@ -1170,6 +1170,7 @@ Handle<SharedFunctionInfo> Compiler::CompileScript(
if (FLAG_serialize_toplevel && if (FLAG_serialize_toplevel &&
compile_options == ScriptCompiler::kConsumeCodeCache && compile_options == ScriptCompiler::kConsumeCodeCache &&
!isolate->debug()->is_loaded()) { !isolate->debug()->is_loaded()) {
HistogramTimerScope timer(isolate->counters()->compile_deserialize());
return CodeSerializer::Deserialize(isolate, *cached_data, source); return CodeSerializer::Deserialize(isolate, *cached_data, source);
} else { } else {
maybe_result = compilation_cache->LookupScript( maybe_result = compilation_cache->LookupScript(
...@@ -1216,6 +1217,8 @@ Handle<SharedFunctionInfo> Compiler::CompileScript( ...@@ -1216,6 +1217,8 @@ Handle<SharedFunctionInfo> Compiler::CompileScript(
compilation_cache->PutScript(source, context, result); compilation_cache->PutScript(source, context, result);
if (FLAG_serialize_toplevel && if (FLAG_serialize_toplevel &&
compile_options == ScriptCompiler::kProduceCodeCache) { compile_options == ScriptCompiler::kProduceCodeCache) {
HistogramTimerScope histogram_timer(
isolate->counters()->compile_serialize());
*cached_data = CodeSerializer::Serialize(isolate, result, source); *cached_data = CodeSerializer::Serialize(isolate, result, source);
if (FLAG_profile_deserialization) { if (FLAG_profile_deserialization) {
PrintF("[Compiling and serializing %d bytes took %0.3f ms]\n", PrintF("[Compiling and serializing %d bytes took %0.3f ms]\n",
......
...@@ -311,7 +311,11 @@ class HistogramTimerScope BASE_EMBEDDED { ...@@ -311,7 +311,11 @@ class HistogramTimerScope BASE_EMBEDDED {
HT(pre_parse, V8.PreParse) \ HT(pre_parse, V8.PreParse) \
/* Total compilation times. */ \ /* Total compilation times. */ \
HT(compile, V8.Compile) \ HT(compile, V8.Compile) \
HT(compile_eval, V8.CompileEval) HT(compile_eval, V8.CompileEval) \
/* Serialization as part of compilation (code caching) */ \
HT(compile_serialize, V8.CompileSerialize) \
HT(compile_deserialize, V8.CompileDeserialize)
#define HISTOGRAM_PERCENTAGE_LIST(HP) \ #define HISTOGRAM_PERCENTAGE_LIST(HP) \
/* Heap fragmentation. */ \ /* Heap fragmentation. */ \
......
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