From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id C1983BCA7 for ; Fri, 25 Feb 2005 14:01:18 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1PD1Ivn019604 for ; Fri, 25 Feb 2005 14:01:18 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA08466 for ; Fri, 25 Feb 2005 14:01:18 +0100 (MET) Received: from hedwig1.umh.ac.be (hedwig2.umh.ac.be [193.190.193.73]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1PD1H56019600 for ; Fri, 25 Feb 2005 14:01:17 +0100 Received: from poincare (mathwifi.swapping.umh.ac.be [10.102.100.18]) by hedwig1.umh.ac.be (8.13.1/8.13.1) with ESMTP id j1PD4n6c266260; Fri, 25 Feb 2005 14:04:57 +0100 Received: from poincare ([127.0.0.1] helo=localhost ident=trch) by poincare with esmtp (Exim 3.36 #1 (Debian)) id 1D4RJv-000166-00; Thu, 24 Feb 2005 23:18:55 +0100 Date: Thu, 24 Feb 2005 23:18:55 +0100 (CET) Message-Id: <20050224.231855.40627447.debian00@tiscali.be> To: "O'Caml Mailing List" Subject: NBody (one more question) From: Christophe TROESTLER In-Reply-To: <20050208104312.GA10035@yquem.inria.fr> References: <20050207.195724.87945401.Christophe.Troestler@umh.ac.be> <20050208104312.GA10035@yquem.inria.fr> Organization: None X-Spook: radar AUTODIN terrorism investigation Mole bootleg lock picking Saddam Hussein MILSATCOM 2600 Magazine X-Blessing: Om Ah Hum Vajra Guru Pema Siddhi Hum X-Operating-System: GNU/Linux (http://www.linux.org/) X-Mailer-URL: http://www.mew.org/ X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.1 (www dot roaringpenguin dot com slash mimedefang) X-Miltered: at nez-perce with ID 421F219E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 421F219D.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; christophe:01 troestler:01 gcc:01 gcc:01 -wall:01 -lm:01 ocaml:01 -wall:01 -lm:01 ocaml:01 compile:01 debian:02 clarify:02 optimization:03 comparable:04 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.5 required=5.0 tests=FROM_ENDS_IN_NUMS autolearn=disabled version=3.0.2 X-Spam-Level: Hi, I'd like to come back to the nbody mini-benchmark with one more question (I apologize if I bother some people but I think there are competent people here who can clarify the situation for me). When I compile the C code with -O0 (with gcc -o nbody.gcc -Wall --fast-math nbody.c -lm), I get a time of 1.513s which is comparable to OCaml (1.607s). But as soon as I turn on -O options (as with gcc -o nbody.gcc -Wall -O1 --fast-math nbody.c -lm), the running time drops down to 0.871s (0.58%). Can somebody tell me what is the optimization that has such an effect and whether it could be applied to OCaml ? (I am not saying or asking it to be done -- it is not up to me to decide -- I just want to understand -- and I am not versed enough in assembly to do it myself unfortunately :( ). Regards, ChriS