chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] Benchmark for "values" - interesting results


From: Peter Bex
Subject: Re: [Chicken-hackers] Benchmark for "values" - interesting results
Date: Wed, 22 May 2013 19:44:01 +0200
User-agent: Mutt/1.4.2.3i

On Mon, May 20, 2013 at 10:40:49PM +0200, Jörg F. Wittenberger wrote:
> Hi,

Hi!

> so far I lived in the believe that returning multiple values would be rather
> slow under Chicken.  This goes back to a remark from Felix, which is several
> years old.

I remember having read or heard something of the sort, as well.

> Maybe it's worth to consider to change the way arguments and return values
> are passed in Chicken.  I know this would be the usual hell to implement.

That sounds extremely painful indeed, and depending on how it's done might
break a lot of code which makes use of the way values can be passed in C
to native Scheme continuations (like the numbers egg does, for example).

But still, it may be worth it.

> To the benchmark I did: I took "partition" from SRFI-1 to be a nice
> example and ran the following tests.  The resulting times are in
> the "profile.ods" file attached.  Code attached as "partition.scm".

We already knew the SRFI implementations shipped with CHICKEN are
extremely inefficient.  It's been a plan to rewrite some of them
using faster internal versions for a while.  Also, the design of
SRFI-1 and SRFI-13 is pretty stupid when considering efficiency,
because many procedures gratuitously accept multiple arguments
and when called differently the procedures may even do slightly
different things, which makes it hard to optimize for.

That said, I'm impressed by your results and I think we can surely
consider this an "early start" for rewriting SRFI-1 :)
On the other hand, if we do decide to rewrite the handling of MV,
this optimization may be a little premature because we don't know
what will be faster, then.

Anyway, because that probably won't happen very soon, attached is
a patch for core to include your drop-in replacement.

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Replace-SRFI-1-s-PARTITION-procedure-with-a-faster-i.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]