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 E419EBC88 for ; Wed, 9 Feb 2005 15:00:16 +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 j19E0GVs016780 for ; Wed, 9 Feb 2005 15:00:16 +0100 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 PAA02812 for ; Wed, 9 Feb 2005 15:00:16 +0100 (MET) Received: from qrnik.knm.org.pl (paf87.warszawa.sdi.tpnet.pl [217.96.225.87]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j19E0Esr003376 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 9 Feb 2005 15:00:15 +0100 Received: from qrczak by qrnik.knm.org.pl with local (Exim 3.36 #1) id 1CysO6-0003kZ-00 for caml-list@inria.fr; Wed, 09 Feb 2005 15:00:14 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] ackermann test X-Face: OW>RV&gN+&b-aiNY|U)f=S%w+/rK!);f>/W9IXg})]&F>ht.1Up8@04+_!gOp(_/l_-+E^. 2\vI)1=D,%HWiq)r(M/V~dr^5T^KF/[w5YZ4<0Sus3+O>l3uA/&W_21m?.s,Po8{pb0@ References: <1107921472.5022.410.camel@pelican.wigram> <877e9a170502082009591db0b4@mail.gmail.com> <1107922403.5022.426.camel@pelican.wigram> <87vf92qe28.fsf@qrnik.zagroda> <20050209111730.GB449@first.in-berlin.de> <1107956075.5022.593.camel@pelican.wigram> From: "Marcin 'Qrczak' Kowalczyk" Mail-Followup-To: caml-list@inria.fr Date: Wed, 09 Feb 2005 15:00:14 +0100 In-Reply-To: <1107956075.5022.593.camel@pelican.wigram> (skaller@users.sourceforge.net's message of "10 Feb 2005 00:34:36 +1100") Message-ID: <87vf91kf4h.fsf@qrnik.zagroda> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: "Marcin 'Qrczak' Kowalczyk" X-Miltered: at nez-perce with ID 420A1770.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 420A176E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ackermann:01 sourceforge:01 gcc:01 -static:01 hacked:01 ocamlopt:01 speedup:01 gcc:01 ocamlopt:01 ...:98 writes:01 ack:01 int:01 int:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: skaller writes: > I only have gcc 3.2.2. With -fomit-frame-pointer and -O3 and -static > for the new C: > > new C w/o old C new Felix old Felix HACKED Ocamlopt Ocamlb > y=10 0.5 0.8 1.8 2.9 7 10 0.4 12 > y=11 7.4 12.5 16 28 55 75 2 50 > y=12 64 98 113 180 290 370 9 220 A further speedup in C: __attribute__((regparm(2))) int ack(int x, int y) { ... } BTW, gcc -O2 and -O3 give the same code here. gcc generates some redundant register moves (I guess regparm is not optimized as well as it could because it's not common), so ocamlopt is still marginally faster. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/