3 ms·
Obviously depends on what you're doing, but in my experience it generally isn't as fast as the C++ I write and compile with a modern compiler. Maybe comparable
by cannam 7y ago
Obviously depends on what you're doing, but in my experience it generally isn't as fast as the C++ I write and compile with a modern compiler. Maybe comparable with other optimised compiled languages with GC. It's not magically fast, but it is quite good at avoiding unexpected slow cases - which can help it "win" even against C++ sometimes.
I generally test with MLton and Poly/ML, and MLton does not always produce faster executables, though most of the time it does. Poly/ML is a good compiler as well, and it has much faster compile times.
- platz 7y agoI assume there is a lot of pointer indirection as is the norm in FP languages that hurts performance quite a bit
- cannam 7y agoYep, I guess it doesn't quite reflect the modern reality for memory and cache access there - although at least primitive types are unboxed, inlined in arrays and records, and represented as machine types. There are probably more opportunities to do that in a whole-program compiler, which doesn't need to carry type information between modules. I believe it also doesn't do SIMD auto-vectorization, which is a recent improvement in C++ compilers that's made a difference to some of my own code.