3 ms·
I'm surprised by how dramatic the difference is between the speed of C and Haskell. One of my professors (at The University of Glasgow, so appropriately a Haske
by mhaymo 13y ago
I'm surprised by how dramatic the difference is between the speed of C and Haskell. One of my professors (at The University of Glasgow, so appropriately a Haskell fan) once claimed that it had "c-like performance".
I suppose that's the point of this paper though, that "c-like performance" is a terribly vague term, meaningless without knowledge of the specific comparisons being made.
- octo_t 13y agoFor lots of algorithms, fairly naive Haskell can get very close in performance (within 10%) of pretty decent C or C++. For example[1] shows that for very advanced algorithms (such as BLAS), Haskell can be very performant - with the optimisation being reusable and transparent to the programmer. [1] - http://research.microsoft.com/en-us/um/people/simonpj/papers/ndp/haskell-beats-C.pdf http://research.microsoft.com/en-us/um/people/simonpj/papers...
- strmpnk 13y agoThat's kind of an odd comparison, using unfused C code compared to fused Haskell code. Their point seems to focus on stream fusion's advantages and possibly that optimizing C takes more effort. To quote the paper: "Clearly “properly”-written C++ can outperform Haskell. The challenge is in figuring out what “proper” means."
- igouy 13y ago>> a terribly vague term, meaningless without knowledge of the specific comparisons being made << otoh http://benchmarksgame.alioth.debian.org/u32/program.php?test=nbody&lang=gcc&id=1 http://benchmarksgame.alioth.debian.org/u32/program.php?test... otoh http://benchmarksgame.alioth.debian.org/u32/program.php?test=nbody&lang=cint&id=1 http://benchmarksgame.alioth.debian.org/u32/program.php?test... :-)
- Paradigma11 13y agoWell, but my Haskell code does not have to beat the best possible c code but only my best c code ;)