War of allocators in JavaScriptCore: another participant

There are a lot of custom allocators in the world, so let's try another promising one, called DLmalloc. It was made by Doug Lea. I've put DLmalloc into JavaScriptCore with the help of the custom allocation framework. I tested DLmalloc only in JavaScriptCore, because it didn't work well with QtWebKit's multi-threaded features. The measurements have been made with QtWebKit, running on x86 Debian-Lenny.





Surprisingly, in the case of SunSpider, DLmalloc took over even TCmalloc a bit. JEmalloc is still the slowest allocator, it's 9.5% slower than DLmalloc. V8 benchmark's performance results show the same tendency as SunSpider. WindScorpion benchmark - which contains real life JavaScript applications - breaks the tendency, since TCmalloc is the fastest allocator in this case, it's even faster than DLmalloc by 3.1%.


Memory consumption



DLmalloc has the same memory consumption as System malloc, which means 19.6% less memory consumption compared to TCmalloc in the case of SunSpider. In the case of V8 and WindScorpion benchmarks, the System's allocator still wins, it has the lowest memory consumption and DLmalloc produces almost the same results.



From the view of performance, although DLmalloc is the fastest on SunSpider and V8 benchmarks, it seems to be a good alternative of TCmalloc, but the difference is not significant to TCmalloc moreover, on WindScorpion it's slower than TCmalloc. If we analyse the memory consumption, a good property of DLmalloc that it produces almost the same memory consumption like System malloc. Unfortunately, as I said, DLmalloc doesn't work well with QtWebKit's multi-threaded features, so it can't be a simple replacement of TCmalloc without further implementation work.

Vince (not verified) - 02/22/2010 - 18:22

Can you describe the test that was done and how the measurements were obtained? Since you're running on Debian-Lenny, I'm assuming you're running with the packaged Glibc, which means that "system malloc" really is a branch of PTmalloc which itself is a branch of DLmalloc with multiple arenas built-in to provide "better" multi-threaded support.

zoltan.horvath - 02/23/2010 - 10:52

Vince, I benchmarked with the JavaScriptCore SunSpider test suite, located in WebKit's trunk/SunSpider directory. The performance results came from the original SunSpider script, the memory results (maximum resident set size) provided by our - FreeBSD `time` like - kernel modification.

Yeah, I was running with the packaged Glibc and you are right, Ptmalloc is a branch of DLmalloc. In this cases, I used DLmalloc without locking (USE_LOCKS=0), this might be an explanation for the good results.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • No HTML tags allowed
  • Lines and paragraphs break automatically.

More information about formatting options

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Fill in the blank