Closed Bug 515287 Opened 15 years ago Closed 15 years ago

Don't trigger GC on every XHR completion

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.2
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: bzbarsky, Assigned: smaug)

References

Details

(Keywords: perf)

Attachments

(1 file)

We trigger a GC after every XHR completion.  We should consider not doing that.  Either only trigger it for completion of parts of a multipart request, or only trigger it every N XHR completions or something...

See bug
Flags: blocking1.9.2?
er, yes.  ;)  I managed to paste it into the "blocks" field!
I think we can remove the whole GC call, since we call MaybeCC(PR_FALSE), 
and that call tries to check if there is lots possible new garbage to collect before calling CC, and CC isn't usually called if user is active.
But I'll do some testing.
In my testing removing this doesn't cause any harm, though doesn't speed
up things too much either.
One problem is that nsJSContext::ScriptEvaluated is called very often, and that
calls MaybeGC, which seems to trigger GC pretty often.
But the nsJSContext::ScriptEvaluated handling is a different bug.
Attachment #399442 - Flags: review?(peterv)
FYI, the GC call was added in Bug 237319.
And I did test multipart XHR.
Based on testing in a debug build (so that I get ifdef DEBUG_smaug log about
when to run CC), the patch does reduce calling CC, but yet when there are enough
new suspected object, it is called.
With the patch and 10 gmail tabs open CC is explicitly called about every 35s
when the browser is in background.
How often does CC get called without the patch in that situation?  I bet more often!
Without the patch I get 
"Running CC was delayed because of NS_MIN_CC_INTERVAL" message quite often.
That means that someone tried to call CC more often than every 10s.
Assignee: nobody → Olli.Pettay
This is borderline blocker material IMO, but it'd be really nice to fix this...
Flags: blocking1.9.2? → blocking1.9.2+
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86 → All
Target Milestone: --- → mozilla1.9.2
Attachment #399442 - Flags: review?(peterv) → review?(bzbarsky)
Attachment #399442 - Flags: review?(bzbarsky) → review+
http://hg.mozilla.org/mozilla-central/rev/c6bcf4347492
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Keywords: perf
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: