While we have probes for callFunction and executeScript, compile is not covered.
Just happen to find this histogram V8.CompileScriptMicroSeconds, which looks like doing a similar thing.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e51107e73a6f93cfb447d6f5b432c100ef31d309 commit e51107e73a6f93cfb447d6f5b432c100ef31d309 Author: maxlg <maxlg@chromium.org> Date: Thu Jul 20 23:07:52 2017 Add a probe for V8.Complie in order to measure the time of compiling script for V8. BUG= 738495 Review-Url: https://codereview.chromium.org/2962353002 Cr-Commit-Position: refs/heads/master@{#488471} [modify] https://crrev.com/e51107e73a6f93cfb447d6f5b432c100ef31d309/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp [modify] https://crrev.com/e51107e73a6f93cfb447d6f5b432c100ef31d309/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp [modify] https://crrev.com/e51107e73a6f93cfb447d6f5b432c100ef31d309/third_party/WebKit/Source/core/frame/PerformanceMonitor.h [modify] https://crrev.com/e51107e73a6f93cfb447d6f5b432c100ef31d309/third_party/WebKit/Source/core/probe/CoreProbes.json5 [modify] https://crrev.com/e51107e73a6f93cfb447d6f5b432c100ef31d309/third_party/WebKit/Source/core/probe/CoreProbes.pidl
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4114d3eab5d02274437e94e477f71abb5e3e956e commit 4114d3eab5d02274437e94e477f71abb5e3e956e Author: Liquan (Max) Gu <maxlg@chromium.org> Date: Fri Jul 28 07:53:19 2017 Plumb the ScriptState for v8Compile probe Because Probe::V8Compile will need a executionContext to work, this change is to provide the script state for Probe::V8Compile. Bug: 738495 Change-Id: I78ef267aa7e3774b7890caf23982d99fe234b293 Reviewed-on: https://chromium-review.googlesource.com/583634 Commit-Queue: Liquan Gu <maxlg@chromium.org> Reviewed-by: Shubhie Panicker <panicker@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#490314} [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp [modify] https://crrev.com/4114d3eab5d02274437e94e477f71abb5e3e956e/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/88d4be6681463c9d7edaf5aee85b0ed79d650f22 commit 88d4be6681463c9d7edaf5aee85b0ed79d650f22 Author: Liquan (Max) Gu <maxlg@chromium.org> Date: Fri Aug 18 07:33:43 2017 Long tasks v2: add probe for v8.compile This CL is to implement probe::V8Compile as an effort to attribute long tasks with the subtasks 'script-compile'. 'script-compile' corresponds to V8ScriptRunner::CompileScript(). The probe records the file name, line and column of the culprit script, and finally become entries in the attribution of long task performance entries. This feature is temporarily hidden behind a command line flag "LongTaskV2". There is a concern about the overhead of using monotonically increasing times for time measurement. In order to evaluate the performance impact, we conduct some experiments on the probe::v8Compile, probe::ExecuteScript and probe::CallFunction. The result has been collected into the following gdoc: https://docs.google.com/a/google.com/document/d/1vV7zxnTp63hiS47t29mvmnmnkgpJe9Kn6mkaCQXhj74/edit?usp=sharing Bug: 738495 Change-Id: I5b4aeb8b89b0e7b7abf641d2197db0a073c2ea9f Reviewed-on: https://chromium-review.googlesource.com/594675 Commit-Queue: Liquan Gu <maxlg@chromium.org> Reviewed-by: Nate Chapin <japhet@chromium.org> Reviewed-by: Alexei Filippov <alph@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Reviewed-by: Timothy Dresser <tdresser@chromium.org> Reviewed-by: Shubhie Panicker <panicker@chromium.org> Cr-Commit-Position: refs/heads/master@{#495497} [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/frame/PerformanceMonitor.h [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/BUILD.gn [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/Performance.cpp [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/Performance.h [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/PerformanceBase.cpp [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/PerformanceBase.h [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/PerformanceLongTaskTiming.cpp [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/PerformanceLongTaskTiming.h [add] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/SubTaskAttribution.cpp [add] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/SubTaskAttribution.h [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/TaskAttributionTiming.cpp [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/TaskAttributionTiming.h [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/core/timing/TaskAttributionTiming.idl [modify] https://crrev.com/88d4be6681463c9d7edaf5aee85b0ed79d650f22/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0722ba251c36c2e817e32a64b50636204fb6c784 commit 0722ba251c36c2e817e32a64b50636204fb6c784 Author: Liquan (Max) Gu <maxlg@chromium.org> Date: Wed Oct 04 23:25:56 2017 remove a no-longer-valid comment in V8ScriptRunner.cpp Probe:v8Compile used to use null for execution context for the unavailability of execution context. Now the execution context has been available and the comment is no longer valid. Bug: 738495 Change-Id: Ic2c107e8c4f6ff22d470b56e16864c309d3d93b9 Reviewed-on: https://chromium-review.googlesource.com/701475 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Liquan Gu <maxlg@chromium.org> Cr-Commit-Position: refs/heads/master@{#506562} [modify] https://crrev.com/0722ba251c36c2e817e32a64b50636204fb6c784/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
Comment 1 by panicker@chromium.org
, Jul 13 2017