Currently, GCController calls Heap::collectAllGarbage directly, which leads to an overload of collections as the timer in GCController and the timer in GCActivityCallback compete for collection time and fire independently. As a result, we end up doing almost 600 full collections during an in-browser run of SunSpider, or 20 full collections on a single load of TechCrunch. We can do better by preventing WebCore from calling collectAllGarbage directly and instead going through Heap::reportAbandonedObjectGraph, since that is what WebCore is trying to do--notify the Heap that a lot of garbage may have just been generated when we left a page.
Created attachment 138891 [details] Patch
With this patch, we do 133 GCs in a run of in-browser SunSpider running 20 iterations. We used to do 712 collections using this same testing setup. We also do 10 collections vs. 20 collections when loading TechCrunch.
I should also mention that neither our wall clock time nor our benchmark score for in-browser SunSpider are affected by this patch.
Comment on attachment 138891 [details] Patch Attachment 138891 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/12520704
Created attachment 138899 [details] Patch
Comment on attachment 138899 [details] Patch r=me
Comment on attachment 138899 [details] Patch Clearing flags on attachment: 138899 Committed r115288: <http://trac.webkit.org/changeset/115288>
All reviewed patches have been landed. Closing bug.