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
[Caml-list] speed
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] speed
> Is it normal that my ocaml program is only 2 times faster than the java 
> counterpart ?(using the same method and complied into native. jdk is 1.4.1

You know, many compiler researchers would kill their whole families to
get speedups by a factor of 2 :-)

James Gosling gave a talk at INRIA recently where he repeated the
party line that JDK 1.4 runs as fast, or even faster, than C++.
So, by transitivity, you're implying that OCaml is twice as fast as C++.

More seriously: Java is nowhere as fast as a good C++ compiler (see
e.g. for an
independent, cross-language benchmark in numerical computing),
but it's not that slow either.  A factor of 2 slower than ocamlopt
sounds broadly reasonable, especially if the program doesn't stress
the GC too much.  Bagley's shootout (
seems to suggest a larger factor (JDK 1.3 slightly slower than OCaml
bytecode), but his figures may be lowered by Java's slow start-up times.

- Xavier Leroy
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: