Memoize and other optimization.

David d at dav1d.de
Fri Aug 17 07:27:41 PDT 2012


Am 17.08.2012 11:45, schrieb David:
> Am 17.08.2012 02:09, schrieb bearophile:
>> David:
>>
>>> Is using std.functional.memoize useful for that function, or is the
>>> lookup slower?
>>
>> This is hard to tell, in general you have to write two versions of your
>> code, and time them.
>
> I though there is a rule of thumb how many array lookups equal an AA
> lookup, so I'll time it.

For anyone interested:

Memoize       No memoize (3000 runs with std.datetime.benchmark)
0.000401645 - 0.00666028


More information about the Digitalmars-d-learn mailing list