Closed Bug 77236 Opened 25 years ago Closed 24 years ago

Move GC to after page load (20ms out of 190ms)

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 42321
mozilla1.0.1

People

(Reporter: ian, Assigned: jst)

Details

(Keywords: perf, Whiteboard: [Hixie-P5])

(found by hyatt during a quantify run of google) When loading a page, we do a GC in SetNewDocument() (in nsGlobalWindow.cpp). We'd like to move the GC till after the onload handler fires, effectively delaying it until we are idle (and the user is reading the page), instead of doing it during the page loading. The code currently says that mContext might get released while doing this (and thus we use a kungFuDeathGrip), but just below it there is a check to see if mContext is still there. This seems to point to either a lurking bug or a reason why we can't move the GC. Any comments?
Keywords: mozilla0.9.1, perf
QA Contact: janc → jrgm
Whiteboard: [Hixie-P5]
Removing this actually slows things down on jrgm's tests.... so this may be an INVALID.
Status: NEW → ASSIGNED
Note: (this may not apply, if hyatt was running with the default page-to-page (non-zero) delay value, but I thought I'd mention it anyways.) If you are running the test with '0' delay in page loads, then the test will never see the benefit of making this change. That is because I measure the "onload to onload" interval, minus whatever delay value is selected. So, if we defer a GC (assuming it is deferable) until after the onload occurs _and_ the delay time is greater than the time required for the GC, then we get the cost of the GC "for free" since it will occur while no page is actively being processed. However, if the delay time is '0', then there is no idle time during the test, and the "cost" of the GC is included in the loading time for each page.
This is a dup of a futured jst bug. Reassigning to him so he can dup it. (We force a GC during every window create/document create.)
Assignee: hyatt → jst
Status: ASSIGNED → NEW
John: the '0 delay' case is artificial and not found in normal browsing situations, so we shouldn't be concerned with whether or not this "fixes" it for that case. :-)
Er, yeah. That was my point: it is artificial. Running the page loader with '0' delay is the wrong way to assess the benefit that a real user, who pauses from page to page, might experience. (But I don't know which way hyatt was testing this, so it may still be moot).
Ok, cool. We're on the same page. Hyatt is indeed doing his tests with a delay, so that should be ok.
Target Milestone: --- → mozilla1.0
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 (you can query for this string to delete spam or retrieve the list of bugs I've moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
jst, you did this already, right? (and it was a win).
Yup, I did this... *** This bug has been marked as a duplicate of 42321 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.