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.