Appender is ... slow

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 15 13:04:20 PDT 2014


On Thursday, 14 August 2014 at 17:16:42 UTC, Philippe Sigaud 
wrote:
> From time to time, I try to speed up some array-heavy code by 
> using std.array.Appender, reserving some capacity and so on.
>
> It never works. Never. It gives me executables that are maybe 
> 30-50% slower than bog-standard array code.
>
> I don't do anything fancy: I just replace the types, use 
> clear() instead of = null...
>
> Do people here get good results from Appender? And if yes, how 
> are you using it?

compiler, version, OS, architecture, flags?

Have you looked at the assembly to check that all the Appender 
method calls are being inlined?


More information about the Digitalmars-d-learn mailing list