Closed
Bug 139243
Opened 24 years ago
Closed 17 years ago
xpconnect should not do JS rooting for wrapped natives
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
People
(Reporter: jband_mozilla, Assigned: jst)
Details
(Keywords: perf)
Attachments
(2 files)
|
9.09 KB,
patch
|
dbradley
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
|
1.47 KB,
text/html
|
Details |
bug 112152 talks about improving threadsafety for wrapped JS objects and getting
rid of JS rooting there. That is kind of tough. But, we can pretty easily kill
the need to do refcount based calls to add and remove JS roots for wrapped
*natives*.
Instead of rooting we can do timely marking. This is better because it avoids
the lock overhead inherent in the JS rooting call. And, it only happens at GC
time rather than each time the refcount on the wrapped natives makes a 1->2 or
2->1 transition.
We might see some measureable improvement in DOM manipulation benchmarks.
I'll attach a patch. I was working on dealing with bug 112152 too. So, this
patch has some associated code that will be needed for that fix, but which is
not *strictly* needed yet for this smaller fix. We should test this more and see
if anything unexpectedly expodes :)
| Reporter | ||
Comment 1•24 years ago
|
||
| Assignee | ||
Comment 2•24 years ago
|
||
This testcase accesses document.nodeType in a tight loop and measures the time
it takes. Accessing document ends up wrapping the document object and also
QI'ing the wrapper in the security manager, so the code that's modified with
this patch is hit quite a lot.
Initial tests show a 9% performance imporvment with this testcase when applying
this patch. Nice :-)
| Assignee | ||
Comment 3•24 years ago
|
||
Comment on attachment 80412 [details] [diff] [review]
proposed fix
sr=jst, makes sense to me.
Attachment #80412 -
Flags: superreview+
Comment 4•24 years ago
|
||
Do we want this for 1.0RC2? Propose it to drivers for pre-approval and linking
to bug 138000 if so.
/be
Updated•24 years ago
|
Comment 5•24 years ago
|
||
Comment on attachment 80412 [details] [diff] [review]
proposed fix
r=dbradley
Is accessing the reference count in HasExternalReferences portable, that is (is
the atomic guarentee for every type of access, or just increment/decrement).
The added assertion in GetNewOrUsed will be a good diagnostic
Attachment #80412 -
Flags: review+
| Reporter | ||
Comment 6•24 years ago
|
||
AFAIK reading a 32bit member is portable in the sense that it always gives a
coherent result. The reason we can avoid locking here is that the only
transition of the value we would not want to race with is the transition from 1
to 2. But, these are wrapped natives and that transition could only happen in
the GetNewOrUsed code that happens within a JS request - i.e. this would be
serialized with the GC.
| Reporter | ||
Comment 7•24 years ago
|
||
I checked this into the trunk. If no problems come up soon I'll push for branch
approval.
| Reporter | ||
Comment 8•24 years ago
|
||
I see that the trunk tinderbox speed tests had a small but measurable
improvement (about 1%) across the board with this checkin. No leak changes (and
I saw no new leaks in my local tests either).
| Assignee | ||
Comment 9•24 years ago
|
||
Sweet!
| Reporter | ||
Comment 10•24 years ago
|
||
I'm reassigning to jst. The change has been on the trunk for quite a while now.
It works well with no problems at all. It is a small change really. This is
primarily a DOM performance fix - though it seems to be an overall speedup.
AFAIK, no one has specifically tested the improvement of startup and new window
creation. They might be significant. jst can push for it getting into the branch
at some point if he wants.
Assignee: jband → jst
Updated•19 years ago
|
QA Contact: pschwartau → xpconnect
Comment 11•17 years ago
|
||
Should just mark this fixed, it was landed ages ago.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•