Beginner's Comparison Benchmark

welkam wwwelkam at gmail.com
Wed May 6 09:59:48 UTC 2020


On Tuesday, 5 May 2020 at 20:29:13 UTC, Steven Schveighoffer 
wrote:
> the optimizer recognizes what you are doing and changes your 
> code to:
>
> writeln(1_000_000_001);
>
Oh yes a classic constant folding. The other thing to worry about 
is dead code elimination. Walter has a nice story where he sent 
his compiler for benchmarking and the compiler figured out that 
the the result of the calculation in benchmark is not used so it 
deleted the whole benchmark.


More information about the Digitalmars-d-learn mailing list