
13 Oct
2006
13 Oct
'06
4:15 p.m.
"Silviu Gheorghe"
slowFunctionCacheList= [slowFunction (i) | i <-[0..5000000]] and use "slowFunctionCacheList !! i" instead of "slowFunction (i)"
i am still curious about a better method (and a general one)
Not much different in principle, but better in practice - you could use an array rather than a list. O(1) lookups should make things (a lot) faster. -k -- If I haven't seen further, it is by standing in the footprints of giants