[Shootout-list] Re: Improvement to Ackermann C function.

Brent Fulgham bfulg@pacbell.net
Fri, 18 Mar 2005 11:19:49 -0800 (PST)


Paul,

--- Paul Hsieh <qed@pobox.com> wrote:
> Other languages like Scheme and OCAML are leveraging
> their power to automatically inline and unroll
> recursive functions.  The thing is, C can do this
> to, its just that you have to do it manually:

This provides a huge speed improvement.  In fact,
gcc blows the socks off of Intel C even with the old
implementation, but this new version makes it a
factor of two or so.  (I need to bump the value of N
again it looks like):

http://shootout.alioth.debian.org/great/sidebyside.php?test=ackermann&p1=icc-0&p2=icc-2&p3=gcc-0&p4=gcc-2&sort=fullcpu

However, I'm afraid that this is a 'cheat', since
we already judged other languages that took this
approach as 'cheats'.

However, since we can show multiple versions for a
given language, I'm very happy to show it.

Thanks,

-Brent