Slow code, slow

Stefan Koch uplink.coder at googlemail.com
Sat Feb 24 09:43:35 UTC 2018


On Friday, 23 February 2018 at 20:15:12 UTC, H. S. Teoh wrote:
> Now that I got your attention:
>
> 	https://issues.dlang.org/show_bug.cgi?id=18511
>
> tl;dr: A trivial piece of code, written as ostensibly 
> "idiomatic D" with std.algorithm and std.range templates, 
> compiles *an order of magnitude* slower than the equivalent 
> hand-written loop.  The way the compiler compiles templates 
> needs some serious improvement.
>
> (And this is why our current fast-fast-fast slogan annoys me so 
> much. One can argue that it's misleading advertising, given 
> that what's considered "idiomatic D", using features like 
> templates and generic code that's highly-touted as D's strong 
> points, compiles a whole order of magnitude slower than C-style 
> D.  Makes me cringe every time I hear "fast code, fast". Our 
> old slogan is a much more accurate description of the current 
> state of things.)
>
>
> T

This particular slowdown happens because there are somehow 
depdencies on std.format.format which is instantiated.
Which has a ton of dependencies itself.


More information about the Digitalmars-d mailing list