isSpace is too slow

2007-05-20 Thread Neil Mitchell
Hi, I'm running a particular benchmark which calls isSpace a lot (basically wc -w). There are three ways to do the underlying space comparison - using the Haskell Data.Char.isSpace, using the C isspace, or using the C iswspace: isspace: 0.375 iswspace: 0.400 Char.isSpace: 0.672 Any chance

Re: isSpace is too slow

2007-05-20 Thread Donald Bruce Stewart
ndmitchell: Hi, I'm running a particular benchmark which calls isSpace a lot (basically wc -w). There are three ways to do the underlying space comparison - using the Haskell Data.Char.isSpace, using the C isspace, or using the C iswspace: isspace: 0.375 iswspace: 0.400 Char.isSpace:

Re: isSpace is too slow

2007-05-20 Thread Neil Mitchell
Hi Want to try also the Data.ByteString.Base.isSpaceWord8 :: Word8 - Bool isspace: 0.375 iswspace: 0.400 ByteString: 0.460 Char: 0.672 Not as fast as isspace/iswspace, but quite a bit faster than Char. Perhaps someone needs to take a peek at the generated ASM for each of these routines

Re: ghc stackfaults

2007-05-20 Thread Arie Peterson
John Meacham wrote: | ghc 6.6 and 6.6.1 both go into infinite loops and eventually die with a | stackfault when trying to compile the attached file with optimizations | turned on. | | [...] | | -- A term, can have values | newtype T v = V (T v) | deriving(Eq,Show,Ord) This seems strange.

Re: isSpace is too slow

2007-05-20 Thread Duncan Coutts
On Sun, 2007-05-20 at 13:42 +0100, Neil Mitchell wrote: Hi Want to try also the Data.ByteString.Base.isSpaceWord8 :: Word8 - Bool isspace: 0.375 iswspace: 0.400 ByteString: 0.460 Char: 0.672 Not as fast as isspace/iswspace, but quite a bit faster than Char. Perhaps someone

How to to terminate runStmt in GHC as a library

2007-05-20 Thread Mads Lindstrøm
Hi all I am trying to build a GUI for GHCi using GHC as a library. See http://haskell.org/haskellwiki/GHC/As_a_library . One requirement is that the GUI is still responsive when executing code using GHC.runStmt. Therefore I do: forkIO $ GHC.runStmt someStatement return() While this works

Feature request/help: evaluating template haskell at runtime

2007-05-20 Thread Rene de Visser
Hello, I am attempting some genetic programming in Haskell. Rather than defining my own data type for programs and writing my own interpreter, I want to use the template haskell expression data types and evaluate them with the rts's byte code interpreter. This gives me a nice fast interpreter

Re: ghc stackfaults

2007-05-20 Thread John Meacham
On Sun, May 20, 2007 at 04:23:58PM +0200, Arie Peterson wrote: John Meacham wrote: | ghc 6.6 and 6.6.1 both go into infinite loops and eventually die with a | stackfault when trying to compile the attached file with optimizations | turned on. | | [...] | | -- A term, can have values |