Streamline integer division #49762
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee = 'https://github.com/mdickinson' closed_at = <Date 2009-03-23.20:04:49.137> created_at = <Date 2009-03-18.22:11:26.021> labels = ['interpreter-core', 'performance'] title = 'Streamline integer division' updated_at = <Date 2009-03-24.09:11:59.959> user = 'https://github.com/mdickinson'
activity = <Date 2009-03-24.09:11:59.959> actor = 'vstinner' assignee = 'mark.dickinson' closed = True closed_date = <Date 2009-03-23.20:04:49.137> closer = 'mark.dickinson' components = ['Interpreter Core'] creation = <Date 2009-03-18.22:11:26.021> creator = 'mark.dickinson' dependencies =  files = ['13368', '13370', '13371', '13391'] hgrepos =  issue_num = 5512 keywords = ['patch'] message_count = 16.0 messages = ['83781', '83782', '83785', '83786', '83788', '83789', '83790', '83791', '83793', '83794', '83795', '83953', '84027', '84066', '84067', '84068'] nosy_count = 3.0 nosy_names = ['mark.dickinson', 'pitrou', 'vstinner'] pr_nums =  priority = 'normal' resolution = 'accepted' stage = None status = 'closed' superseder = None type = 'performance' url = 'https://bugs.python.org/issue5512' versions = ['Python 3.1', 'Python 2.7']
The text was updated successfully, but these errors were encountered:
Here's a patch that streamlines the x_divrem function in
Using the pidigits_bestof.py script that's posted in the bpo-4258
So the patch gives a speedup of around 90%. This particular benchmark
Would it be possible to include integer benchmark tools to upstream? I
Useful informations for an integer benchmark:
Who has the last version of pidigit tool? Can you attach it here? :-)
# No patch
# With faster_integer_division.patch
Ok, it's two times faster on 64 bits CPU!!!
Other notes about pidigits:
Updated patch. Lots of cleanup, but only one significant change: the
A few more timings, this time from doing a single huge integer division:
32-bit build, 15-bit digits, unpatched: 92382.2 ms (~7.5 ns)
... and just for fun, the other combinations:
64-bit build, 15-bit digits, unpatched: 61927.5 ms (~5.1 ns)
Thanks for the updated pidigits script, Victor! Maybe this is too small