Modern C++ Lamentations

Jon Degenhardt jond at
Mon Dec 31 21:47:42 UTC 2018

On Monday, 31 December 2018 at 13:20:35 UTC, Atila Neves wrote:
> Blog:
> Reddit:
> Hacker news something something dark side.

LTO often helps optimize range code (and phobos code generally), 
so I tried it out on the variants in your repo. Indeed, the range 
variants improve, but not the others. Still doesn't bring the 
range version into line with other three variants.

Compile lines:
* No LTO:  ldc2 -O2
* LTO:  ldc2 -O2 -flto=thin 

LDC 1.13.0; Macbook Pro, 16GB RAM.

The runtime for simple, lambda, and generator variants came in at 
120ms each for both LTO off and LTO on. The range version was 
1080ms for no LTO, and 780ms with LTO.

I bumped N up to 3000 to see if more differentiation would show 
up. There was some, but overall the results were still very 
consistent with N at 1000.


More information about the Digitalmars-d mailing list