Fast temporary dynamic arrays? (And slicing of them)

bearophile bearophileHUGS at lycos.com
Tue Sep 7 09:54:52 PDT 2010


Steven Schveighoffer:
> Note that the new appender uses heap data to store its implementation, so  
> it's not as quick as it could be.  This is per Andrei's requirement that  
> it be a reference type.

Thank you for your answers. But I don't fully understand your answer. Do you mean it uses the Pimpl idiom, and allocates the struct on the heap?

I use appender only when performance is important. The appender is a hack useful because array appending in D is very slow (and even appender is quite slow), so it must be first of all fast, otherwise it's not useful.

I generally use appender inside the scope of a single function.

So unless I am missing something I think Andrei requirement is/was wrong.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list