18 May 18:21
Re: Re: Write Haskell as fast as C.
Andrew Coppin <andrewcoppin <at> btinternet.com>
2008-05-18 16:21:44 GMT
2008-05-18 16:21:44 GMT
Ketil Malde wrote: > Ketil Malde <ketil <at> malde.org> writes: > > >>> data EvidenceCode = IAC | IUG | IFR | NAC | NR | ... deriving Show >>> > > >> Could it be that this derived read instance is somehow very inefficient? >> > > To answer my own question: this is exactly it, ghc derives less than > optimal code in this case. Rather than reiterate the case here, I did > a quick writeup at http://blog.malde.org/, and would be quite happy > about any feedback or suggestions. > I think you'll find the code that GHC derives for a Read instance handles extra whitespace and all kinds of other whatnot that you don't actually need in this specific case. I suspect this is what's up - but I don't have any hard proof for that.![]()
RSS Feed