chicken-hackers
[Top][All Lists]
Advanced

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

[PATCH] Pick rest argument values directly from the argvector without co


From: Peter Bex
Subject: [PATCH] Pick rest argument values directly from the argvector without consing
Date: Sun, 27 Oct 2019 13:16:10 +0100
User-agent: Mutt/1.10.1 (2018-07-13)

Hi all,

Here's my patch for https://bugs.call-cc.org/ticket/1623.
The commit message should provide sufficient details to understand
what it does, I hope.

This super simple benchmark runs 25% faster with -O3:

(define (foo #!optional (a 1) (b 2))
  (+ a b))

(time
  (let lp ((i 0))
    (unless (= i 100000000)
      (foo 1 3)
      (lp (add1 i)))))

I'm not 100% sure it's worth the extra complexity given that this
is not a huge speedup and this kind of code isn't very common.
On the other hand, it's kind of neat and there might be cases where
code benefits a lot from this.  The SRFI-13 code for example gets
almost all rest argument list reification eliminated when compiled
with this new version.

The srfi-13 benchmarks in our chicken-benchmarks repo don't show much
of a difference, though.

Cheers,
Peter

Attachment: 0001-Replace-car-cdr-null-on-rest-args-with-direct-argvec.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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