Author vstinner
Recipients h.venev, mark.dickinson, rhettinger, skrah, vstinner
Date 2014-07-05.12:43:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1404564181.79.0.0590372120373.issue21922@psf.upfronthosting.co.za>
In-reply-to
Content
Hi, I worked on a similar patch 6 years ago, while Python 3.0 was developped:
https://mail.python.org/pipermail/python-dev/2008-November/083315.html
http://bugs.python.org/issue1814

The summary is that using GMP makes Python slower because most numbers are small: fit in [-2^31; 2^31-1], and GMP allocation is expensive.

There is also a license issue: GMP license is GPL which is not compatible with the Python license.

If you want to work on large numbers, you can gmpy:
https://code.google.com/p/gmpy/

"""
The following testcases yield 42x performace improvement:
- 16384-bit RSA on 8 threads on quad-core with HT # GIL released
- Multiplying 5600000-bit ints
- Dividing 6000000-bit ints
- Converting 300000-character str to int(base=10)
- Converting 1250000-bit int to str
"""

That's not a common use case. Run the Python benchmark suite with your patch to see if your patch has a similar overhead than my old patch.
http://hg.python.org/benchmarks
History
Date User Action Args
2014-07-05 12:43:01vstinnersetrecipients: + vstinner, rhettinger, mark.dickinson, skrah, h.venev
2014-07-05 12:43:01vstinnersetmessageid: <1404564181.79.0.0590372120373.issue21922@psf.upfronthosting.co.za>
2014-07-05 12:43:01vstinnerlinkissue21922 messages
2014-07-05 12:43:01vstinnercreate