Monthly Archives: December 2007

Bye Bye Allocations

Everyone has been working quite hard lately to get rid of allocations.  I’d like to call out jst, sicking, smaug, dbaron, brendan, igor, and crowder for their help, patches and suggestions over the last few weeks.

Just looking at our startup allocation test, we’ve removed about 100,000 allocations.  Other tests show far, far bigger gains.

allocation graph

We’ve been very successful in converting quite a few heap allocations to use small stack buffers instead.  We’ve found places where we didn’t need to do any allocation at all and just removed themMany of these improvements have come in our DOM and XPConnect code which not only helps reduce fragmentation but also results in performance gains for sites with lots of DOM access (not to mention our UI!).  We’ve also gotten startup speed improvements.

Smaug has done some great work getting content to use arenas.  There are some issues with the arena implementation and we need to get some more stats, but this is a good step in the right direction.

We’ve got more things in the pipeline so I expect this number to continue to drop.