Re[Haskell-cafe] [2]: Re[2]: Re[2]: Reduction Sequence of
simple Fibonacci sequence implementation
staafmeister
g.c.stavenga at uu.nl
Fri Aug 28 07:31:13 EDT 2009
Bulat Ziganshin-2 wrote:
>
> Hello staafmeister,
>
> Friday, August 28, 2009, 3:03:13 PM, you wrote:
>>> so it should keep a list of all values ever computed in program,
>>> together with their expressions? :) are you like idea of prod[1..10^6]
>>> computation taking 10 mbytes of memory?
>
>> The list you give prod is also 10 MB so it not a terribly inefficient
>> program.
>
> no, it's produced on need so it needs O(1) memory
>
>> It's a factor of 2. Well haskell also has often a factor of 2 overhead
>> with
>> respect to C and people are not terribl concerned about that
>
> factor of 2 compared to ALL VALUES ever produced when evaluating
> program. since computer performs about 10^9 computations per second,
> you are going to store 10^9 values each second, some of those may be
> multi-megabyte by itself
>
>
Hi Bulat,
All the values that are computed but are also GCed (and they will be, 10^9
bytes
is the mem limit). If the GC removes a value then all references in cache to
those
values can also be removed.
Gerben
--
View this message in context: http://www.nabble.com/Reduction-Sequence-of-simple-Fibonacci-sequence-implementation-tp25178377p25188333.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe
mailing list