Boost logo

Boost :

Subject: Re: [boost] Metaprogram benchmarks
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2012-04-05 13:47:00

On 03/04/12 18:56, Dave Abrahams wrote:
> In order to measure the compile-time efficiency of various C++11
> metaprogramming techniques, I'd like to put together a set of
> benchmarks, and I wanted to discuss here what kinds of tests might be
> appropriate. Aleksey and I came up with some benchmarks for an appendix
> to, but some of those are lost and they're
> all getting a bit crusty. Certainly, I have no confidence that they are
> realistic or useful. If anyone has ideas about this, I'd be very
> glad to hear them.

I can't suggest a particular benchmark, but I will say that these days I
find compile-time memory usage a bigger problem than compile-time
runtime when it comes to complex metaprograms. So, whatever benchmarks
you do, please include memory usage statistics too.

In particular, I was hoping that constexpr would help in this case
because it wouldn't be memoized like templates are, but I believe gcc at
least has chosen to implement constexpr with memoization, so I guess it
won't be more than a constant factor better.

John Bytheway

Boost list run by bdawes at, gregod at, cpdaniel at, john at