[cfe-dev] Fibonacci template metaprogram performance

Douglas Gregor dgregor at apple.com
Fri May 29 11:40:38 PDT 2009


Here are some quick-n-dirty performance results for template  
instantiation in Clang and GCC 4.2. The test is very simple: measure  
compilation time (-fsyntax-only) for a translation unit that computes  
the Nth Fibonacci number via a template metaprogram. Clang appears to  
be scaling linearly (or close to it) with the number of  
instantiations. And, although you can't see it in the chart, Clang is  
a little over 2x faster than GCC at the beginning (Fibonacci<100>).

	- Doug

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fibonacci.pdf
Type: application/pdf
Size: 55789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090529/a392b024/attachment.pdf>


More information about the cfe-dev mailing list