Blog Post: Beating std::visit Without Really Trying

user1234 user1234 at 12.de
Sat Oct 5 09:54:55 UTC 2019


On Saturday, 5 October 2019 at 02:59:58 UTC, Paul Backus wrote:
> I was curious how C++17's std::variant compared to the options 
> we have in D, like Algebraic and SumType, so I did a simple 
> comparison of the generated assembly for each of them. You can 
> read about it at the link below. And as you can probably guess 
> from the title, D comes out ahead, in the end.
>
> https://pbackus.github.io/blog/beating-stdvisit-without-really-trying.html
>
> This is my first attempt at sharing something like this, so any 
> comment or feedback is very much appreciated!

getting typeinfo in D leads to a double indirection. Making a 
tagged union is clearly a better alternative and the results of 
SumType vs Algebraic are not a surprise. I pointed this to the 
main maintainer of D-YAML a while back but at this time there was 
more serious bottlenecks. If you read this "El Pinguino"...


More information about the Digitalmars-d-announce mailing list