[gambit-list] Avoid make_array

Marc Feeley feeley at iro.umontreal.ca
Fri Nov 6 09:19:10 EST 2009


On 2009-11-06, at 9:14 AM, Alex Queiroz wrote:

> Hallo,
>
> On 11/6/09, Christian Jaeger <chrjae at gmail.com> wrote:
>> Also, you can try to lessen the amount of memory allocations. Make
>> sure that for floating point calculations you're using the fl...
>> operations and that you use the flonum and not safe declarations in
>> those parts of the code; and/or instead of allocating temporary
>> objects always freshly, reuse them and mutate their contents. Also if
>> your allocations are mostly closures, play with the linining-limit,
>> and avoid passing closures to other compilation units (instead put  
>> the
>> called code into the same unit).
>>
>
>     Thanks for all the tips! Actually the allocations are mostly due
> to creating 64-bit integers, which are bignums. Those are the keys
> calculated from game positions, used in the hash table. I guess I'll
> implement the transposition table and related functions in C, it will
> cut garbage collection time (and hash calculation time) to a minimum.

Did you consider using a smaller hash that can fit in a fixnum?

Marc



More information about the Gambit-list mailing list