Table lookups - this is pretty definitive

Walter Bright newshound2 at digitalmars.com
Tue Apr 1 12:40:13 PDT 2014


On 4/1/2014 12:22 PM, Denis Shelomovskij wrote:
> Compiler used: dmd -O -inline -release

For me, rewriting main() as:

void main()
{
   {
     auto r = benchmark!(f0, f1, f2)(100_000);
     writefln("Milliseconds %s %s %s", r[0].msecs, r[1].msecs, r[2].msecs);
   }
   {
     auto r = benchmark!(f0, f1, f2)(100_000);
     writefln("Milliseconds %s %s %s", r[0].msecs, r[1].msecs, r[2].msecs);
   }
}

Gives:

Milliseconds 139 99 15
Milliseconds 122 93 13




More information about the Digitalmars-d mailing list