On Wed, Jun 13, 2012 at 12:56 AM, Roman Leshchinskiy
r...@cse.unsw.edu.auwrote:
It doesn't change the semantics of your program but it can make it
significantly slower (or faster, as in this case). The various state hack
related tickets on trac might give you an idea of what is happening
On 12 Jun 2012, at 12:52, Dmitry Dzhus d...@dzhus.org wrote:
12.06.2012, 01:08, Roman Leshchinskiy r...@cse.unsw.edu.au:
perhaps the state hack is getting in the way.
I don't quite understand the internals of this yet, but `-fno-state-hack`
leads to great performance in both cases!
How
12.06.2012, 01:08, Roman Leshchinskiy r...@cse.unsw.edu.au:
perhaps the state hack is getting in the way.
I don't quite understand the internals of this yet, but `-fno-state-hack` leads
to great performance in both cases!
How safe is that?
___
Hello everyone.
I wonder why using do notation with `-` can ruin the performance.
In essence the problem is that, for some action `f :: m Double`,
running the code (in my case, `standard` from mwc-random).
f
for million times is fast but the code
do
v - f
return v
is
Well, it's not do notation, since replacing standard g with standard g =
return gives the same poor performance. I wonder if it has something to do
with error checking.
On 11 Jun 2012, at 13:38, Dmitry Dzhus wrote:
Hello everyone.
I wonder why using do notation with `-` can ruin the
On 11 Jun 2012, at 10:38, Dmitry Dzhus wrote:
main = do
g - create
e' - VU.replicateM count $ standard g
return ()
In all likelhood, ghc is spotting that the value e' is not used, and that there
are no side-effects, so it does not do anything at runtime. If you expand the
action
11.06.2012, 14:17, Malcolm Wallace malcolm.wall...@me.com:
that there are no side-effects
There are — PRNG state is updated for RealWorld, that's why monadic replicateM
is used.
You can add something like
print $ (VU.!) e 50
after e is bound and still get 0.057 sec with do-less
On 11/06/2012, at 10:38, Dmitry Dzhus wrote:
Consider this simple source where we generate an unboxed vector with million
pseudo-random numbers:
8 -
import qualified Data.Vector.Unboxed as VU
import System.Random.MWC
import System.Random.MWC.Distributions (standard)
count =