<··········@gmail.com> wrote:
> Anyone care to give me some pointers on how to figure out why this
> function, consistentp, is consing ...
[...]
> (find (the (unsigned-byte 32) (node-value node-i))
> (node-not node-j)
> :test #'=))
FIND indirectly calls a function that takes &rest arguments (#'=).
Since CMUCL doesn't support allocation of &rest lists on the stack by
default, the list needs to be consed.
One workaround is to use a non-variadic function as the :TEST.
(find (the (unsigned-byte 32) (node-value node-i))
(node-not node-j)
:test (lambda (a b) (= a b)))
--
Juho Snellman
On Sat, 07 Jan 2006 09:31:05 +0100, Juho Snellman <······@iki.fi> wrote:
Wow! That was an eye opener.
I never realized the potentially huge gains in performance
that can be achieved by putting rest aguments on the stack before..
> <··········@gmail.com> wrote:
>> Anyone care to give me some pointers on how to figure out why this
>> function, consistentp, is consing ...
> [...]
>> (find (the (unsigned-byte 32) (node-value node-i))
>> (node-not node-j)
>> :test #'=))
>
> FIND indirectly calls a function that takes &rest arguments (#'=).
> Since CMUCL doesn't support allocation of &rest lists on the stack by
> default, the list needs to be consed.
>
> One workaround is to use a non-variadic function as the :TEST.
>
> (find (the (unsigned-byte 32) (node-value node-i))
> (node-not node-j)
> :test (lambda (a b) (= a b)))
>
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/