Closed Bug 107265 Opened 24 years ago Closed 24 years ago

2.8% of window close time in JS_ClearScope

Categories

(Core :: JavaScript Engine, defect, P1)

x86
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.6

People

(Reporter: dbaron, Assigned: brendan)

References

Details

(Keywords: js1.5, perf)

Attachments

(1 file)

2.8% of window close time (23 hits in the profile cited on bug 104127) is spent in JS_ClearScope, at the stack: js_FlushPropertyCacheByProp js_DestroyScopeProperty js_DropScopeProperty js_free_symbol JS_HashTableDestroy js_hash_scope_clear js_Clear JS_ClearScope GlobalWindowImpl::SetNewDocument(nsIDOMDocument*, int) DocumentViewerImpl::Close() nsDocShell::Destroy() (Well, ok, this is the stack for 22 of the 23 hits in JS_ClearScope -- the other hit I saw was locking within JS_Free from within js_hash_scope_clear.)
I'll make this better now. /be
Status: NEW → ASSIGNED
Keywords: js1.5, mozilla0.9.6
Priority: -- → P1
Target Milestone: --- → mozilla0.9.6
Attached patch proposed fixSplinter Review
I want to nail this before double hashing, which I need to get back to stat. How about fast r= and sr= if this makes dbaron happy? /be
Keywords: perf
Re-profiling showed much fewer hits in one profile (and mostly in free) and no hits at all in another profile, so this seems to have helped.
Comment on attachment 55482 [details] [diff] [review] proposed fix r=shaver.
Attachment #55482 - Flags: review+
Comment on attachment 55482 [details] [diff] [review] proposed fix sr=jband No nesting can prematurely clear cx->clearingScope in a way that would matter?
Attachment #55482 - Flags: superreview+
jband: control flows into clear, then to js_free_symbol, to js_DropScopeProperty, which calls js_DestroyScopeProperty on last deref; the only other calls are to js_FreeSlot, js_FlushPropertyCacheByProp, and JS_free. No nesting possible on a given cx. /be
Hey, you know, someone later might change this code and not realize that the lack of nesting is really important. JS_ASSERT(cx->clearingScope) before you set it to false, as a safety net?
shaver, I'm about to decimate this code for double hashing. See bug 62164. But ok, I'll add an assert for the short run ("someone later" -- as if!). /be
Yeah, yeah. Indulge me.
Fixed. /be
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Marking Verified based on dbaron's findings at 2001-10-28 16:52 above -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: