Skip to content

Monthly Archives: October 2013

I got 99 problems, but they’re all due to template over-instantiation


TL;DR: Small C++ code change with templates has large impact (2% libxul codesize reduction). nsTArray has an inheritance structure that looks like this: template<class E> class nsTArray : public nsTArray_Impl<E, nsTArrayInfallibleAllocator> { … }; template<class E, class Alloc> class nsTArray_Impl : public nsTArray_base<Alloc, nsTArray_CopyElements<E> >, public nsTArray_TypedBase<E, nsTArray_Impl<E, Alloc> > { … }; // Most […]

faster c++ builds by building bigger groups of code


There have been a lot of spectacular build changes going into the tree lately; my personal builds have gotten about 20% faster, which is no mean feat.  One smaller change that I’ve implemented in the last couple weeks is compiling the DOM bindings and the IPDL IPC code in what we’re been calling “unity” mode. […]