chicken-hackers
[Top][All Lists]
Advanced

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

Re: [PATCH] Pick rest argument values directly from the argvector withou


From: Jörg F . Wittenberger
Subject: Re: [PATCH] Pick rest argument values directly from the argvector without consing
Date: 27 Oct 2019 16:22:58 +0100

Thanks Peter for investing your time into this.

While I did not proof-read your code, my bet is that this kind of optimizations do add up at the end of the day.

On Oct 27 2019, Peter Bex wrote:

On Sun, Oct 27, 2019 at 01:16:10PM +0100, Peter Bex wrote:
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've tested some more, and the more rest arguments you add, the
bigger the difference is (because more needs to be consed onto
the stack).  With 4 arguments (which are all supplied in the call),
it is 40% faster.  With 8 arguments it is 60% faster etc.

Of course most procedures will only have a handful of rest arguments.

Likely. Though I've seen graphics code, which had a huge amount of keyword args. Will this change speed them up too?

Cheers,
Peter




reply via email to

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