Re: Optimization of IORefs and STRefs - comparison to g++

2016-01-09 Thread Henning Thielemann
How about just using alloca, peek and poke - like C guys do in order to get C's speed? ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

Re: Optimization of IORefs and STRefs - comparison to g++

2015-12-11 Thread Akio Takano
Hi Mateusz, IORef and STRef are boxed references. That is, they are a mutable cell that contains a pointer to some immutable Haskell value. When you increment a (STRef Int), you first dereference the pointer, allocate a new immutable heap object to represent the new integer value, then mutate the

Re: Optimization of IORefs and STRefs - comparison to g++

2015-12-11 Thread Michael Snoyman
My mutable-containers package has unboxed and storable references actually. On Fri, Dec 11, 2015, 12:26 PM Akio Takano wrote: > Hi Mateusz, > > IORef and STRef are boxed references. That is, they are a mutable cell > that contains a pointer to some immutable Haskell value.