English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ackermann test
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-09 (14:00)
From: Marcin 'Qrczak' Kowalczyk <qrczak@k...>
Subject: Re: [Caml-list] ackermann test
skaller <skaller@users.sourceforge.net> 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/