static array litteral syntax using a library solution (no GC and 40x faster!)

John Colvin john.loughran.colvin at gmail.com
Sun Feb 3 10:24:13 PST 2013


On Sunday, 3 February 2013 at 15:16:44 UTC, Max Klyga wrote:
> On 2013-02-03 13:18:03 +0000, John Colvin said:
>
>> On Sunday, 3 February 2013 at 09:23:01 UTC, timotheecour wrote:
>>> snip
>> 
>> Very interesting! Anything that beats c performance is a very 
>> big plus for D.
>> 
>> Btw,  you can replace the loop in S with
>> ret[] = a[];
>> Which should be even faster.
>> 
>> Also, to check that the assignment is being optimised away,  
>> try using different data in each pass.
>
> It will not get faster, not only that. It will not even compile.
>
> If look carefully, you will notice that it is in fact a static 
> foreach and a is not an array, but a tuple, so the whole loop 
> is unrolled as a series of assignments (ret[0] = a, ret[1] = b 
> …)

Woops, sorry my bad


More information about the Digitalmars-d mailing list