Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Is OCaml fast?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-22 (13:43)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: Is OCaml fast?

On 22-11-2010, Thanassis Tsiodras <> wrote:
> I apologize beforehand if this is not the forum to ask.
> I am on the fence about whether to learn OCaml or not, and while
> reading an article called "Why OCaml"
> (, I saw
> that OCaml was praised for the speed of the executables it generates -
> and was referred to, speed-wise, as "second to none", except C and
> C++.
> However, when I actually went to the Language Shootout page suggested
> in the article, I found out that OCaml is not 2nd, it is 13th, behind
> languages like Haskell and C#...
> (

Shootout benchmarks doesn't always allow to set some variables that
could greatly improve the speed of OCaml.

> Is it just hype, then? Or am I missing something?

You could write very fast application with OCaml -- even beating C code
in some case. But what OCaml is really helpful for, is that you can do
algorithmic optimizations that improve the speed. It means that OCaml
is terse enough to allow you to write complex algorithm without making
too much bugs. 

All in all: development time + execution time is fast.

But if you spend 10x development time on the same C code, you will
obviously get something faster in C. 

Sylvain Le Gall