On 29 April 2004 10:17, David Sabel wrote:
>> You could try out that theory by copying the definition of
>> unsafePerformIO into your code, and putting an INLINE pragma on it.
>> I think it's safe to do this in your case (it's not safe in general).
>
> That's interesting for me, in which situati
Hi,
> > Results:
> >
> >method runtime (s)
> >---
> >pure0.7
> >ffi 3.2
> >fastMut 15
> >ioref 23
>
> I very strongly suspect that it is the unsafePerformIO that hurts
> performance in the fastMut
On Tue, Apr 20, 2004 at 01:59:33PM +0100, Simon Marlow wrote:
> On 20 April 2004 12:48, Bernard James POPE wrote:
>
> > Results:
> >
> >method runtime (s)
> >---
> >pure0.7
> >ffi 3.2
> >fastMut 15
> >ioref
On Tue, Apr 20, 2004 at 02:56:36PM +0200, Ketil Malde wrote:
> Bernard James POPE <[EMAIL PROTECTED]> writes:
>
> > Note each program was compiled with ghc 6.2 with -O2 on debian linux.
> :
> > main = print $ loop 1 0
>
> Isn't this going to be optimized away to a constant w
Hi Andre,
> There's another way which you missed: using implicit parameters. I
> remember reading a paper a while ago called Global Variables in Haskell
> (sorry, don't remember the author -- Jones, perhaps?) which did similar
> benchmarking to yours, and carrying around the global variable wi
On 20/04/2004, at 9:48 PM, Bernard James POPE wrote:
To test out the various possible ways of implementing a global counter
I wrote some test cases (shown below). I hope the test cases are
useful, and provide some indication of the relative performance.
However, if you spot something bogus please
On 20 April 2004 12:48, Bernard James POPE wrote:
> Results:
>
>method runtime (s)
>---
>pure0.7
>ffi 3.2
>fastMut 15
>ioref 23
I very strongly suspect that it is the unsafePerformIO that hurts
per
Bernard James POPE <[EMAIL PROTECTED]> writes:
> Note each program was compiled with ghc 6.2 with -O2 on debian linux.
:
> main = print $ loop 1 0
Isn't this going to be optimized away to a constant with -O2?
-kzm
--
If I haven't seen further, it is by standing in the foot
On Thu, Apr 15, 2004 at 10:43:22AM -0700, Carl Witty wrote:
> > > However, if you have any suggestions about how to make a FAST
> > > global counter
> > > I would be very glad to hear it. From profiling it seems like
> > > this code
> > > is a little expensive (also it is called quite frequently)
> > However, if you have any suggestions about how to make a FAST
> > global counter
> > I would be very glad to hear it. From profiling it seems like
> > this code
> > is a little expensive (also it is called quite frequently).
>
> You could try the FastMutInt module from GHC
> (ghc/compiler/ut
> So I have code like:
>
>{-# NOINLINE count #-}
>count :: IORef Int
>count = unsafePerformIO $ newIORef 0
>
>{-# NOINLINE getCount #-}
>getCount :: (Int -> a) -> a
>getCount f
> = let nextCount
> = (unsafePerformIO $
> do oldCount <- r
On Thu, Apr 15, 2004 at 01:52:38PM +1000, Bernard James POPE wrote:
>
> However, if you have any suggestions about how to make a FAST global counter
> I would be very glad to hear it. From profiling it seems like this code
> is a little expensive (also it is called quite frequently).
Well, I'm no
On Tue, Apr 13, 2004 at 02:03:21PM +0100, Simon Marlow wrote:
>
> > On Fri, Apr 09, 2004 at 03:27:01PM +0200, David Sabel wrote:
> >
> > > you can turn off let-floating by compiling without optimizations,
> > > i.e. without using a -O flag or using -O0 explicitly.
> > > The disadvantage is that
> On Fri, Apr 09, 2004 at 03:27:01PM +0200, David Sabel wrote:
>
> > you can turn off let-floating by compiling without optimizations,
> > i.e. without using a -O flag or using -O0 explicitly.
> > The disadvantage is that most of all other optimizations
> > are turned off too.
>
> That is exa
On Fri, Apr 09, 2004 at 03:27:01PM +0200, David Sabel wrote:
> you can turn off let-floating by compiling without optimizations,
> i.e. without using a -O flag or using -O0 explicitly.
> The disadvantage is that most of all other optimizations
> are turned off too.
That is exactly what I'm doin
Hi,
you can turn off let-floating by compiling without optimizations,
i.e. without using a -O flag or using -O0 explicitly.
The disadvantage is that most of all other optimizations
are turned off too.
Another possibility would be to compile your program with HasFuse
http://www.ki.informati
On Tue, Apr 06, 2004 at 09:38:38AM +0100, Simon Peyton-Jones wrote:
> Strangely (and bogusly) there is no such flag in GHC6.2. Someone must
> have noticed this already because it's there in the HEAD
> (-fno-full-laziness), and has been since Feb 2004. Strange.
Thanks,
I think it would be good f
Strangely (and bogusly) there is no such flag in GHC6.2. Someone must
have noticed this already because it's there in the HEAD
(-fno-full-laziness), and has been since Feb 2004. Strange.
Simon
| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:glasgow-haskell-users-
| [EMAIL PROTECT
18 matches
Mail list logo