Author mark.dickinson
Recipients christian.heimes, gregory.p.smith, mark.dickinson, pitrou, vstinner
Date 2009-02-16.16:47:27
SpamBayes Score 1.30679e-12
Marked as misclassified No
Message-id <1234802918.49.0.302750226435.issue4258@psf.upfronthosting.co.za>
In-reply-to
Content
Updated patch against py3k.  I'm interested in getting this into the trunk 
as well, but py3k is more important (because *all* integers are long 
integers).  It's also a little more complicated to do this for py3k 
(mostly because of all the small integer caching), so backporting to
2.7 is easier than trying to forward port a patch from 2.7 to 3.1.

Notes:

- I've added a configure option --enable-big-digits (there are probably 
better names), enabled by default.  So you can use --disable-big-digits
to get the old 15-bit behaviour.

- I *think* this patch should work on Windows; confirmation would be 
appreciated.

- I've removed the fast multiplication code, in the interests of keeping 
the patch simple.  If this patch goes in, we can concentrate on speeding 
up multiplication afterwards.  For now, note that 30-bit digits give
the *potential* for significant speedups in multiplication and division 
(see next item).

- There's a nasty 'feature' in x_divmod: the multiplication in the 
innermost loop is digit-by-twodigits -> twodigits, when it should be 
digit-by-digit -> twodigits;  this probably causes significant slowdown 
with 30-bit digits.  This may explain Antoine's outlier.
Again, if this patch goes in I'll work on fixing x_divmod.

- Re: Victor's comment about a 'base' attribute:  I tried this, but
quickly discovered that we still need the 'bits_per_digit' for tests.
I think that binaryness is so ingrained that it's not really worth
worrying about the possibility of the base changing from a power of 2 to a 
power of 10.  So in the end I left base out.

- It did occur to me that NSMALLPOSINTS and NSMALLNEGINTS might usefully 
be exposed in sys.int_info, mostly for the purposes of testing.  Thoughts?
History
Date User Action Args
2009-02-16 16:48:38mark.dickinsonsetrecipients: + mark.dickinson, gregory.p.smith, pitrou, vstinner, christian.heimes
2009-02-16 16:48:38mark.dickinsonsetmessageid: <1234802918.49.0.302750226435.issue4258@psf.upfronthosting.co.za>
2009-02-16 16:47:37mark.dickinsonlinkissue4258 messages
2009-02-16 16:47:35mark.dickinsoncreate