Avoiding CAF's

Neil Mitchell ndmitchell at gmail.com
Wed May 16 09:22:22 EDT 2007


Hi

> See this thread:
>
> http://www.nabble.com/%7B---INLINE-me_harder---%7D-tf3599366.html

I'll try and see if I can do this with RULES.


> | foreign import ccall safe "stdio.h getchar" getchar2 :: CInt
> |
> | Can I stop this being CAF'd in any way?
>
> What is the problem you are trying to solve?

I have written an optimiser for Haskell in Yhc Core, and I'm now
trying to spit out optimised Haskell so GHC can create a binary to get
top performance. The main loop is given in: http://hpaste.org/1862

The FFI call must create a IO monad box to put the thing in, then the
main loop strips the IO box away. If I could avoid the overhead of
creating the box in the meantime, that would be preferable.

With that loop I'm about 10% slower than C on the "wc -c" problem
using "getchar" as the character supply, using String = [Char] - and
about 25% faster than GHC.

Thanks

Neil


More information about the Glasgow-haskell-users mailing list