[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Write this accumuator in a functional style

On 13/07/17 16:09, Rustom Mody wrote:
> Pavol Lisy wrote:
>> IMHO problem is doubling size for huge lists.
>> Or waste big memory for huge frozensets. I mean resize it to 2*N if
>> its size is just N+1.
> Couple that with the fact that space-time are not unrelated on any modern VM based OS + cache based hw. Doubly so for "managed" languages where gc buys space for time.

You might want to do some benchmarks to sound out that idea.  I believe 
conventional wisdom is that the time cost of allocating more memory and 
extending the list outweighs the space cost of wasted memory.

Rhodri James *-* Kynesim Ltd