Bug 153502 - Web Inspector: Better handle JavaScriptCore Recompilation for Inspector (Debugging, Profiling)
Summary: Web Inspector: Better handle JavaScriptCore Recompilation for Inspector (Debu...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-01-26 12:36 PST by Joseph Pecoraro
Modified: 2016-12-13 15:38 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-01-26 12:36:34 PST
* SUMMARY
Better handle JavaScriptCore Recompilation for Inspector (Debugging, Profiling).

There are two aspects to this bug:

  1. Recompilation is work that should not be unnecessarily performed.
    - Inspector should do a better job of only triggering recompile to avoid unnecessary work

  2. Enabling each set of extra byte codes incurs a performance cost of just running JavaScript.
    - Inspector should do a better job of informing the user / changing the conditions based on the use case
    - Generic debugging should not need profiling overhead (exception right now is console.profile which may happen at any time)
    - High Fidelity profiling may not want debugging overhead (debugging incurs about a 2x slowdown)

The biggest concern I see right now is the 2x overhead of Debugging, which would skew high fidelity profiling scenarios. The overhead of the sampling profiler may be so low that it would be reasonable to keep it on all the time while the inspector is open.


* NOTES
- Currently open the inspector causes "2 recompilations" as soon as a frontend is created
  - 1 for debugger attaching to add "Debugging" byte codes (for breakpoints)
  - 1 for profiling (TimelineAgent) to add "Profiling" byte codes
- I don't know at the moment if a recompilation actually does any immediate work or not. I suspect it doesn't.
Comment 1 Radar WebKit Bug Importer 2016-01-26 12:36:54 PST
<rdar://problem/24352603>
Comment 2 Timothy Hatcher 2016-01-26 12:41:32 PST
It would be good to avoid attaching the debugger if all breakpoints are disabled.