Blog Post: Beating std::visit Without Really Trying

Paul Backus snarwin at gmail.com
Sun Oct 6 22:05:49 UTC 2019


On Sunday, 6 October 2019 at 21:49:59 UTC, Joseph Rushton 
Wakeling wrote:
> I'm not fluent in assembly so, leaving the error path aside, I 
> wasn't sure how to interpret the "main path" assembly from the 
> D and Rust code, and whether they were practically equivalent 
> (clearly the assembly posted looked different). Can anyone 
> offer any interpretation there?

Both the D-with-SumType and Rust versions optimize the main path 
of the function down to a single array lookup. The reason they 
look different is that the assembly for the D version uses AT&T 
syntax (which is the default for GNU tools like objdump), and the 
assembly for the Rust version uses Intel syntax.


More information about the Digitalmars-d-announce mailing list