[webkit-dev] reclaim of number cells

Zoltan Herczeg zherczeg at inf.u-szeged.hu
Thu Jun 26 02:38:04 PDT 2008

Hi All,

I am Zoltan Herczeg, working for the Dept. of Soft. Eng., Univ. of Szeged.
I am currently investigating the JavaScriptCore engine to find some
speed-up solutions. During my investigation, I have encountered an
interesting issue for the Garbage Collector. Namely, in the case of some
sunspider benchmark programs, the GC is frequently called. For example,
the runtime of 3d-cube is 121 msec, and it calls the slow Collect()
function about 170 times. Thus, the garbage collecting takes the large
portion of its runtime (~30%). Such benchmarks cunsume the available
Number Cells in a short time, so the GC has a lot of work to reclaim these
cells. My idea is to have a simple algorithm, which can reclaim many of
these cells without the help of the GC. I have attached an experimental
patch, and the performance-results as well. As you can see, it is a rather
selective patch. Some programs benefit from it (25% performance improve
for 3d-cube), while some do not (like controlflow-recursive, which does
not allocate any number cells at all). Perhaps this approach could be a
custom-speedup, which should be turned on, when a treshold value is
reached. (Number of collects() in a given time is greater than a
pre-defined value.) However, the mainloop (Machine:: PrivateExecute)
should be duplicated in this case, which is not an easy task because of
the computed gotos. Do you have any other idea to make this patch useful?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc-improve-34737.patch
Type: application/octet-stream
Size: 18549 bytes
Desc: not available
Url : http://lists.webkit.org/pipermail/webkit-dev/attachments/20080626/b86efe30/attachment.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: compare.txt
Url: http://lists.webkit.org/pipermail/webkit-dev/attachments/20080626/b86efe30/attachment.txt 

More information about the webkit-dev mailing list