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 BDB9BBC88 for ; Wed, 9 Feb 2005 12:44:20 +0100 (CET) Received: from first.in-berlin.de (dialin-145-254-052-109.arcor-ip.net [145.254.52.109]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j19BiJTR032420 for ; Wed, 9 Feb 2005 12:44:20 +0100 Received: by first.in-berlin.de (Postfix, from userid 501) id 6E3F2AA14F; Wed, 9 Feb 2005 12:17:31 +0100 (CET) Date: Wed, 9 Feb 2005 12:17:31 +0100 From: Oliver Bandel To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ackermann test Message-ID: <20050209111730.GB449@first.in-berlin.de> References: <1107921472.5022.410.camel@pelican.wigram> <877e9a170502082009591db0b4@mail.gmail.com> <1107922403.5022.426.camel@pelican.wigram> <87vf92qe28.fsf@qrnik.zagroda> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87vf92qe28.fsf@qrnik.zagroda> User-Agent: Mutt/1.5.6i X-Miltered: at nez-perce with ID 4209F793.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; oliver:01 bandel:01 oliver:01 in-berlin:01 caml-list:01 ackermann:01 wrote:01 sourceforge:01 writes:01 tail:01 ack:01 ack:01 int:01 int:01 benchmark:02 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: On Wed, Feb 09, 2005 at 10:26:39AM +0100, Marcin 'Qrczak' Kowalczyk wrote: > skaller writes: > > >> Where can I find the C code you are using? > > > > int ack(int x, int y) { > > return x==0? y+1: (y==0? ack(x-1,1):ack(x-1,ack(x,y-1))); > > } > > If you write it like this: > > int ack(int x, int y) { > if (x==0) return y+1; > if (y==0) return ack(x-1,1); > return ack(x-1,ack(x,y-1)); > } > > then gcc-3.4.3 generates better code (optimizes tail calls). > -fomit-frame-pointer further speeds it up. Would be nice to have the comlete benchmark again - now with this code (or with an added row for this C-Code). So we can compare, what reults will yielded by that different code on the same platform for which we saw the other benchmark values. Ciao, Oliver