Post about comparing C, C++ and D performance with a real world project

helxi brucewayneshit at gmail.com
Sat Dec 9 13:36:54 UTC 2017


On Friday, 8 December 2017 at 15:40:08 UTC, Steven Schveighoffer 
wrote:
> On 12/7/17 8:11 PM, Mengu wrote:
>> On Thursday, 7 December 2017 at 22:39:44 UTC, Daniel Kozak 
>> wrote:
>>> The other slowdown is caused by concatenation. Because 
>>> std::string += is more simillar to std.array.(Ref)Appender
>> 
>> wait, i thought appenders performed better than concatenation. 
>> is that not true or did i just misunderstand your post?
>> 
>
> You misunderstood. Appender is faster than ~= to a straight 
> array, because it doesn't have to do any opaque lookups in the 
> GC to see if it needs to reallocate -- all the information is 
> right there.
>
> Daniel's point was that Appender is more akin to std::string 
> (which doesn't have the benefit of having language-defined 
> array operaions). If the blogger used Appender, he would have 
> had better performance.
>
> -Steve

As a new comer, I find these very educational. I wish there was a 
documentation or a book to warn D learners about these pitfalls.

"Effective D" when?  :D


More information about the Digitalmars-d mailing list