Subject: Re: Performance tuning
From: Erik Naggum <>
Date: 2000/12/05
Newsgroups: comp.lang.lisp
Message-ID: <>

* Robert Monfera <>
| Did you use a rather low-level direct access to parts of a bignum, or
| maybe there are some standard functions that mutate a bignum, avoiding
| consing (which I expected + and some other arithmetic operations could
| do, but when I looked, they couldn't)?

  Allegro CL offers a function sys:memref that becomes machine code
  which simply accesses the memory given as arguments.  I used it to get
  at the individual bigits.  There are no standard functions to mutate
  bignums that I know of.  Moreover, bignums take up only as many bigits
  as they need, so I had to use a "sentinel" bit to get bignums big
  enough that I didn't have to test for the proper size of the bignum.
  So, yes, this is rather low-level direct access to parts of a bignum.

  "When you are having a bad day and it seems like everybody is trying
   to piss you off, remember that it takes 42 muscles to produce a
   frown, but only 4 muscles to work the trigger of a good sniper rifle."
								-- Unknown