Sujet : Re: Optimization flag for unchecked fixnums in SBCL?
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.lispDate : 10. Aug 2024, 05:00:51
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87zfplhyjg.fsf@nightsong.com>
References : 1 2
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Jeff Barnett <
jbb@notatt.com> writes:
As a start, did you you try defining collatz and clen with defsubst?
Did you try using declarations and their cousins? And did your CL
system provide a decent, declaration-sensitive compiler?
I didn't try defsubst. I did try some declarations but didn't get them
to work. I think that means I didn't use them properly, rather than
that they don't work. Yes, SBCL is a serious optimizing compiler. If
not the premier compiler, it is one of them.
Other than use defsubst. That should open code most anything in most
any CL compiler-based system.
I think the issue is not funcall overhead, but rather, the slowness of
bignum arithmetic compared to just hoping that everything fits in a
fixnum. The "trick" of this Euler problem is that a few (only a few) of
the intermediate values will overflow a 32 bit word. But, everyone uses
64 bit machines these days, so that part works anyway.