Closed Bug 650326 Opened 11 years ago Closed 11 years ago

Optimize ExpireGCChunks

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gwagner, Assigned: gwagner)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 2 obsolete files)

I was looking at the cornell box benchmark. 
The average GC pause time decreased from about 200-500ms to 30-70ms because of the background finalization. There are still a few spikes in there with 200ms pauses caused by releasing the chunks.
Maybe we want to move the chunk returning to the background thread as well.


URL: http://29a.ch/sandbox/2010/cornellbox/
Attached patch patch (obsolete) — Splinter Review
Moving ExpireGCChunks to the background thread.
Assignee: general → anygregor
Attachment #531993 - Flags: review?(igor)
Attached patch patch (obsolete) — Splinter Review
Oh we need a special case for last context GC.
Attachment #531993 - Attachment is obsolete: true
Attachment #531993 - Flags: review?(igor)
Comment on attachment 532009 [details] [diff] [review]
patch

Review of attachment 532009 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsgc.cpp
@@ +2666,5 @@
>          JS_ASSERT(cx->gcBackgroundFree == &rt->gcHelperThread);
>          cx->gcBackgroundFree = NULL;
>          rt->gcHelperThread.startBackgroundSweep(rt);
>      } else {
> +        ExpireGCChunks(rt);

js_FinishGC destroys the chunks on its own. So we do not need to do anything special here except perhaps a comment about js_FinishGC. r+ with that fixed.
(In reply to comment #3)
> Comment on attachment 532009 [details] [diff] [review] [review]
> patch
> 
> Review of attachment 532009 [details] [diff] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: js/src/jsgc.cpp
> @@ +2666,5 @@
> >          JS_ASSERT(cx->gcBackgroundFree == &rt->gcHelperThread);
> >          cx->gcBackgroundFree = NULL;
> >          rt->gcHelperThread.startBackgroundSweep(rt);
> >      } else {
> > +        ExpireGCChunks(rt);
> 
> js_FinishGC destroys the chunks on its own. So we do not need to do anything
> special here except perhaps a comment about js_FinishGC. r+ with that fixed.

Oh yes that's right. Back to the original patch. Thx!
Attached patch patchSplinter Review
Attachment #532009 - Attachment is obsolete: true
Attachment #532018 - Flags: review?(igor)
Comment on attachment 532018 [details] [diff] [review]
patch

Review of attachment 532018 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #532018 - Flags: review?(igor) → review+
http://hg.mozilla.org/tracemonkey/rev/c5e3c81d35ba
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/c5e3c81d35ba
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.