std.variant benchmark

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jul 29 07:17:52 PDT 2012


On 7/29/12 8:17 AM, Gor Gyolchanyan wrote:
> std.variant is so incredibly slow! It's practically unusable for
> anything, which requires even a tiny bit of performance.

You do realize you actually benchmark against a function that does 
nothing, right? Clearly there are ways in which we can improve 
std.variant to the point initialization costs assignment of two words, 
but this benchmark doesn't help. (Incidentally I just prepared a class 
at C++ and Beyond on benchmarking, and this benchmark makes a lot of the 
mistakes described therein...)


Andrei


More information about the Digitalmars-d mailing list