--8323328-157775539-11574941844954
Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-157775539-1157494184=:24954"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323328-157775539-11574941844954
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Tue, 5 Sep 2006, Ondrej Bilka wrote:

> With GMP benchmark I discovered that multipling 2 fixnums into bignum is 
> slow because it multiplies 2 temporary bignums. Without heavy magic its 
> unsolvable.

What's the heavy magic like? Abstract out multiplication as something that 
happens between two or three BDIGIT* pointers (depending on whether it's 
inplace or not). This will allow to use temporary stack-allocated 
BDIGIT[], which is much faster than VALUE and GC.

Unless #coerce is currently involved in creating the temporaries?

BTW, is there any plan to use harmonics in order to speed up very very big 
multiplications? I mean like, pad the two bignums to the size of the 
result rounded up to a product of powers of small primes, then apply a 
forward Fast Fourier Transform on both bignums, then do pointwise complex 
multiplication, then do an inverse Fast Fourier Transform on the resulting 
spectrum and perform a carry pass. (here, each digit holder has to be much 
bigger than the digit it holds, because handling carries can only be done 
completely at the end)

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - t˝═:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montr˝┬l QC Canada
--8323328-157775539-11574941844954--
--8323328-157775539-11574941844954--