|
Re: loop performance bug: msg#00074lang.haskell.glasgow.bugs
We can make it a little faster by not doing bound checks: > test4 :: IO () > test4 = do > (arr :: IOUArray Int Bool) <- newArray_ (0,100*100-1) > doFromTo 0 9999 $ \_ -> > doFromTo 0 99 $ \y -> > doFromTo 0 99 $ \x -> > unsafeWrite arr (x*(y+1)) False Timings (compiled with -O2): test1: 12.6s test2: 8.5s test3: 1.9s test4: 1.3s -- Friendly, Lemmih
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: loop performance bug, Josef Svenningsson |
|---|---|
| Next by Date: | Re: loop performance bug, Lemmih |
| Previous by Thread: | Re: loop performance bug, Josef Svenningsson |
| Next by Thread: | Re: loop performance bug, Lemmih |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |