Possible change to array runtime?

Steven Schveighoffer schveiguy at yahoo.com
Fri Mar 14 07:48:15 PDT 2014


On Thu, 13 Mar 2014 11:24:01 -0400, Steven Schveighoffer  
<schveiguy at yahoo.com> wrote:


> arr.length = 0;
>
...
> 3. Don's company uses D1 as its language, I highly recommend watching  
> Don's Dconf13 presentation (and look forward to his Dconf14 one!) to see  
> how effective D code can create unbelievable speed, especially where  
> array slices are concerned. But to the above line, in D2, they must add  
> the following code to get the same behavior:
>
> arr.assumeSafeAppend();

Just a quick note, buried in same thread that Don mentioned, he outlined a  
more specific case, and this does not involve setting length to 0, but to  
any arbitrary value.

This means my approach does not help them, and although it makes sense,  
the idea that it would help Sociomantic move to D2 is not correct.

-Steve


More information about the Digitalmars-d mailing list