I dun a DIP, possibly the best DIP ever

user1234 user1234 at 12.de
Sat Apr 25 10:29:15 UTC 2020


On Saturday, 25 April 2020 at 10:11:08 UTC, Stefan Koch wrote:
> On Saturday, 25 April 2020 at 09:35:45 UTC, user1234 wrote:
>> [...]
>
> this is for the following code:
>
> ---
> import std.meta;
> alias big_seq = AliasSeq!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
> 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 
> 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 
> 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, /*goes 
> towards 4096*/); // this line was abbreviated.
> version(dotdotdot)
> {
>     enum x = (big_seq + 3)...;
> }
> else
> {
>     template Add3(alias y)
>     {
>         enum Add3 = y + 3;
>     }
>
>     enum x = staticMap!(Add3, big_seq);
> }
>
> pragma(msg, x.length + x[$-1]);
>
> dmd fresh from walters branch release build with ldmd(ldc) 1.20
> time:
> 0m0.230s
> time for a fresh dmd build under the same conditions with that 
> patch reverted:
> 0m0.270s
> time for doing it with our "..." patch:
> 0m0.030s
>
> these numbers are just a best out of 3 measurement so please 
> only see them as a rough guide.

ok, thanks.

But i'd like to say that Walter's PR doesnt interfere with the 
project presented in this topic. Maybe we can get Walter 
improvment quickly merged and then later yours as well, as it is 
more complex.


More information about the Digitalmars-d mailing list