From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA30294; Fri, 3 Jan 2003 14:32:30 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA30290 for ; Fri, 3 Jan 2003 14:32:29 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h03DWLr22292; Fri, 3 Jan 2003 14:32:22 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA30286; Fri, 3 Jan 2003 14:32:21 +0100 (MET) Date: Fri, 3 Jan 2003 14:32:21 +0100 From: Xavier Leroy To: onlyclimb Cc: caml-list@inria.fr Subject: Re: [Caml-list] speed Message-ID: <20030103143221.B29601@pauillac.inria.fr> References: <3E15B3B3.3040106@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3E15B3B3.3040106@163.com>; from onlyclimb@163.com on Fri, Jan 03, 2003 at 04:00:51PM +0000 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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++. Yippee! More seriously: Java is nowhere as fast as a good C++ compiler (see e.g. http://www.coyotegulch.com/reviews/almabench.html 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 (http://www.bagley.org/~doug/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 caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners