Computer Language Shootout - concurrency

Ulf Wiger (AL/EAB) ulf.wiger@REDACTED
Fri Dec 2 11:34:44 CET 2005


Nick Linker wrote:
> 
> Sean Hinde wrote:
> 
> > Hi,
> >
> > Looks great.
> 
> A fly in the ointment - the Ackermann function: 
> http://shootout.alioth.debian.org/gp4/benchmark.php?test=acker
> mann&lang=all
> 
> Erlang HiPE - 15th place. ;-)


Maybe we should have something like Ada 95 GNAT:

pragma Suppress(All_Checks);

;-)

Seriously, I tried inserting is_integer/1 guards,
and it actually slowed things down significantly.

I thought that, worst case, it wouldn't make a 
difference. As it is now, the compiler inserts
the is_integer/1 checks, but doesn't act on the 
result. Eventually, the function splus_2 in 
erl_arith.c ends up being called, and it turns
around and calls erts_mixed_plus(), which is 
so complex, I didn't even bother to understand it.
It does handle all combinations of smallints, 
bignums and floats.

Isn't it so that the most common case of all
(and probably one of the most frequently 
executed operations) would be smallint_plus_2()?

If there were is_smallint/1 guards, the compiler
could probably speed this up significantly.
It would still have to check for bignum results,
of course.

Of course, I'm no compiler writer, so I'm fully
prepared for someone to tell me that I don't have
the faintest idea what I'm talking about. (:

/Uffe

> 



More information about the erlang-questions mailing list