Evan Martin (evan) wrote in evan_tech,
Evan Martin

speed is not an excuse

What first got me down this wacky programming-languages path was getting curious about O'Caml and its reputation for speed. Then, as an O'Caml programmer who had heard about how all the cool kids were talking about Haskell, I had avoided it because it had to be slow (strings are linked lists!).

It turns out that in completely flawed microbenchmarks, Haskell ends up being in the general range of "decently fast" -- comparable to Java and often orders of magnitude faster than than "good enough" languages like Python or Perl. (Poor Ruby is almost reliably the slowest, often by a factor of a hundred.)

There are a few lessons here: the first, of course, is that microbenchmarks are not especially meaningful. Another is that you can uglify up Haskell code to make it fast if you want to.

But the important one is that the standard "premature optimization is the root of all evil" argument still applies, even when strings are implemented as linked lists. Ruby is obviously fast enough for plenty of projects. What ultimately matters more is what will get your job done the quickest.
Tags: haskell, programming languages

  • dremel

    They published a paper on Dremel, my favorite previously-unpublished tool from the Google toolchest. Greg Linden discusses it: "[...] it is capable…

  • your vcs sucks

    I've been hacking on some Haskell stuff lately that's all managed in darcs and it's reminded me of an observation I made over two years ago now (see…

  • google ime

    Japanophiles might be interested to learn that Google released a Japanese IME. IME is the sort of NLP problem that Google is nearly uniquely…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.