Fastest Way to Append Multiple Elements to an Array

zeljkog via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 18 14:27:06 PST 2014


On 18.12.14 14:50, Steven Schveighoffer wrote:
> I wonder how your code compares to this:
> 
> void append(T)(ref T[] arr, T[] args...)
> {
>     arr ~= args;
> }

This is ~20% slower for ints, but it difference  increases for bigger structs.


More information about the Digitalmars-d-learn mailing list