2010/8/10 Laurent PETIT <laurent.pe...@gmail.com>

>
>
> 2010/8/10 Nicolas Oury <nicolas.o...@gmail.com>
>
> On Tue, Aug 10, 2010 at 10:08 AM, Laurent PETIT <laurent.pe...@gmail.com>
>> wrote:
>> > Naive question from someone who has not really used Scheme in practice :
>> > beyond the memory footprint problem (which may or may not be a problem
>> > depending on the memory size of an element in the initial list, and also
>> > depending on whether you're recurring over a datastructure, or a
>> presumably
>> > very long lazy seq), isn't there an impact on CPU usage too ?
>>
>> It would probably be up to twice as slow, I would say.
>> For a list that is continuous in memory and continuations that are
>> allocated perfectly in memory,
>> you would need to go through twice the same amount of memory.
>> (I assume that the main cost here is going through the memory)
>>
>
>
> Isn't this improbable (your assumption about the main cost) ? Even for the
> smallest accumulating computation such as doing an addition or consing
> things (which requires memory allocation, etc.), I'm not certain that there
> wouldn't be near-to-an-order-of-magnitude between the "going through the
> memory" and the "accumulator computation" ?
>

The more I think about it, the more I tend to consider that it's just the
memory footprint of ( size of an intermediate result x number of elements of
the coll ) which counts. With the caveat that sometimes saying "if the coll
can stay in memory and the size of an intermediate result is negligeable
compared to the size of an element of the coll, everything's ok" may not
work if we're not really holding the coll in memory, but rather computing a
very long lazy seq / lazy tree.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to