[erlang-questions] how to do faster integer operations (was: some language changes)

Paul Mineiro <>
Fri Jun 8 02:10:48 CEST 2007


On Thu, 7 Jun 2007, Jason Dusek wrote:

> On 6/7/07, Paul Mineiro <> wrote:
> > Wrt the straightforward answer, port and linked-in driver actually had
> > worse performance than straight Erlang with hipe.  So it's not clear how
> > to do it in C while maintaining a desirable job, except maybe to write
> > a new BIF which I couldn't find any documentation on (and I assume is
> > generally discouraged).
> >
> > By the way, is it expected that the port and linked-in driver versions
> > would be slower than native Erlang with hipe?  I was guessing it's
> > because the C executes in circa 100ns so communication overhead was
> > dominating.
>
> Well, what if you wrote the hashing function as a list operation and
> passed a *list* to C -- then that would be way faster... Is there any
> reason not to do that?

Do you mean, batching up the calls to the linked-in driver to amortize the
communication overhead?  I do believe this would work.  It does create
some complication however because the way the function is used (there is
not necessarily multiple units of work to be done).

Happily, with the speed improvements achieved by going to 64 bit, this
portion is no longer a bottleneck.

-- p



More information about the erlang-questions mailing list