Hello Donald,
Thursday, November 2, 2006, 2:21:31 PM, you wrote:
>> 10-20 times difference is typical for GHC programs.
> It's really more like 2-4x. Sometimes better than C.
> Where's this huge figure coming from Bulat? If you have code that
> behaves like this, you should report it.
are you
Hi & no problems (I didn't tell it clearly right away),
I modified the code along the comments given by Lemmih and things
improved a lot. mod-operator can be removed by two loops as in C
version, which still further improved the speed. I tried this with
the old version and the speed-up was next
Oh, sorry, I thought your version was a rewritten version of mine. :)
The names are so similar, after all.
On Nov 2, 2006, at 02:26 , isto wrote:
Hi,
When writing IO version, I wasn't aware of other twister versions,
and the only reason is/was that it was easiest to me and that I knew
(believe
bulat.ziganshin:
> Hello isto,
>
> Thursday, November 2, 2006, 1:16:55 AM, you wrote:
>
> > I have tried to do different things but now I'm stuck. unsafeRead
> > and unsafeWrite improved a bit the lazy (STUArray-version) and
>
> why you think it's a lazy? :) ST monad is just the same as IO mon
Hello Lennart,
Thursday, November 2, 2006, 6:04:39 AM, you wrote:
> The whole point of writing the Mersenne Twister was that I wanted to
> show how a stateful computation could be encapsulated in the ST monad
> and none of it showing up outside. This aspect of the code is
> totally gone now
Hello Lennart,
Thursday, November 2, 2006, 4:34:04 AM, you wrote:
> A big problem with the Mersenne Twister is the shifts. As has been
> noted elsewhere, ghc doesn't do such a great job on those.
#ifdef __GLASGOW_HASKELL__
(I# a) <<# (I# b) = (I# (a `iShiftL#` b))
(I# a) >># (I# b) = (I# (a
Hello isto,
Thursday, November 2, 2006, 1:16:55 AM, you wrote:
> I have tried to do different things but now I'm stuck. unsafeRead
> and unsafeWrite improved a bit the lazy (STUArray-version) and
why you think it's a lazy? :) ST monad is just the same as IO monad
internally, only types are dif
Hi,
When writing IO version, I wasn't aware of other twister versions,
and the only reason is/was that it was easiest to me and that I knew
(believed) that plain lists would have been inefficient. I just wanted
to see and learn, how close to C version this can be made. (And still
do.)
There we
lemmih:
> On 11/1/06, isto <[EMAIL PROTECTED]> wrote:
> >Hi all,
> >
> >On HaWiki was an announcement of MersenneTwister made by Lennart
> >Augustsson. On a typical run to find out 1000th rnd num the output
> >is (code shown below):
> >
> >$ time ./testMTla
> >Testing Mersenne Twister.
> >Resu
The whole point of writing the Mersenne Twister was that I wanted to
show how a stateful computation could be encapsulated in the ST monad
and none of it showing up outside. This aspect of the code is
totally gone now when everything is in the IO monad. Is there some
good reason to have i
On 11/2/06, Lennart Augustsson <[EMAIL PROTECTED]> wrote:
A big problem with the Mersenne Twister is the shifts. As has been
noted elsewhere, ghc doesn't do such a great job on those.
Actually, the shifts are only evaluated once (hurrah for lazy
evaluation) and with -funfolding-use-threshold=1
On 11/1/06, isto <[EMAIL PROTECTED]> wrote:
Hi all,
On HaWiki was an announcement of MersenneTwister made by Lennart
Augustsson. On a typical run to find out 1000th rnd num the output
is (code shown below):
$ time ./testMTla
Testing Mersenne Twister.
Result is [3063349438]
real0m4.925
A big problem with the Mersenne Twister is the shifts. As has been
noted elsewhere, ghc doesn't do such a great job on those.
-- Lennart
On Nov 1, 2006, at 20:17 , Donald Bruce Stewart wrote:
Now, this will be hard to get close the the highly tuned C.
Possibly its
doable.
The mai
Now, this will be hard to get close the the highly tuned C. Possibly its
doable.
The main tricks are documented here:
http://haskell.org/haskellwiki/Performance/GHC#Unboxed_types
Inspecting the Core to ensure the math is being inlined and unboxed will
be the most crucial issue, I'd imagine.
Hi all,
On HaWiki was an announcement of MersenneTwister made by Lennart
Augustsson. On a typical run to find out 1000th rnd num the output
is (code shown below):
$ time ./testMTla
Testing Mersenne Twister.
Result is [3063349438]
real0m4.925s
user0m4.856s
I was exercising with the
15 matches
Mail list logo