This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients christian.heimes, collinwinter, gregory.p.smith, jyasskin, loewis, mark.dickinson, pitrou, schuppenies, vstinner
Date 2009-02-17.23:00:19
SpamBayes Score 5.973211e-11
Marked as misclassified No
Message-id <1234911624.34.0.482041659208.issue4258@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, let's try 30bit_longdigit14.patch:

   patch -p0 < 30bit_longdigit14.patch
   autoconf && autoheader
   ./configure && make

I'm using two computers:

 - marge: Pentium4, 32 bits, 3 GHz (32 bits)
 - lisa: Core Quad (Q9300), 64 bits, 2.5 GHz (64 bits)

Both uses 32 bits digit (and 64 bits twodigits), py3k trunk and Linux.

* My bench_int.py:

  - 32-bit without patch: 1670.7 ms
  - 32-bit with patch:    1547.8 ms (+7.4%)
  - 64-bit without patch: 885.2 ms
  - 64-bit with patch:    627.1 ms (+29.2%)

* pidigits 2000 (I removed the calls to print): 
  lowest result on 5 runs:

  - 32-bit without patch: 2991.5 ms
  - 32-bit with patch:    3445.4 ms (-15.2%) SLOWER!
  - 64-bit without patch: 1949.9 ms
  - 64-bit with patch:     973.0 ms (+50.1%)

* pybench.py (minimum total)

  - 32-bit without patch: 9209 ms
  - 32-bit with patch:
  - 64-bit without patch: 4430 ms
  - 64-bit with patch:    4330 ms (=)

pybench details:

Test            32 bits (without,patch) | 64 bits (without,patch)
-----------------------------------------------------------------
   CompareFloatsIntegers:  293ms  325ms |  113ms    96ms
         CompareIntegers:  188ms  176ms |  129ms    98ms
     DictWithIntegerKeys:  117ms  119ms |   73ms    69ms
SimpleIntFloatArithmetic:  192ms  204ms |   84ms    80ms
 SimpleIntegerArithmetic:  188ms  196ms |   84ms    80ms
-----------------------------------------------------------------

On 64 bits, all integer related tests are faster. On 32 bits, some
tests are slower.

Sum up: on 64 bits, your patch is between cool (30%) and awesome 
(50%) :-) On 32 bits, it's not a good idea to use 32 bits digit 
because it's a little bit slower.

=> I would suggest to use 2^30 base only if sizeof(long)>=8 (64 bits 
CPU).

Note: I already get similar result (2^30 is slower on 32 bits CPU) in 
older tests.
History
Date User Action Args
2009-02-17 23:00:24vstinnersetrecipients: + vstinner, loewis, collinwinter, gregory.p.smith, mark.dickinson, pitrou, christian.heimes, jyasskin, schuppenies
2009-02-17 23:00:24vstinnersetmessageid: <1234911624.34.0.482041659208.issue4258@psf.upfronthosting.co.za>
2009-02-17 23:00:20vstinnerlinkissue4258 messages
2009-02-17 23:00:19vstinnercreate