Bug 9552 - script debugger should only attach to JavaScriptCore when there are listeners
Summary: script debugger should only attach to JavaScriptCore when there are listeners
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-23 00:05 PDT by Timothy Hatcher
Modified: 2006-06-23 12:59 PDT (History)
0 users

See Also:


Attachments
Implements the lazy attach (12.88 KB, patch)
2006-06-23 00:10 PDT, Timothy Hatcher
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2006-06-23 00:05:44 PDT
Right now the script debuggers always attach when you have the WebScriptDebuggerEnabled default set. This does not mean we have any registered listeners.

When using a build that has these debuggers attached there is around a 50% performance impact on the JS 24Fun test.

We need to lazily attach the debuggers to all frames when the first listener is added. Once all the listeners are detached we can then remove the listeners, regaining peek performance.
Comment 1 Timothy Hatcher 2006-06-23 00:10:28 PDT
Created attachment 8976 [details]
Implements the lazy attach
Comment 2 Timothy Hatcher 2006-06-23 00:11:42 PDT
"Once all the listeners are removed we can then detach the debuggers, regaining peek performance."
Comment 3 Geoffrey Garen 2006-06-23 11:59:03 PDT
Comment on attachment 8976 [details]
Implements the lazy attach

I would make these changes:

- "Attaches a script debugger to all frames for the receiver."
+ "Attaches a script debugger to all frames belonging to the receiver."

-    @abstract Detaches any script debuggers from all frames for the receiver.
+    @abstract Detaches all script debuggers from all frames belonging to the receiver.

r=me
Comment 4 Timothy Hatcher 2006-06-23 12:59:15 PDT
Landed in r14990.