classification
Title: Optimize mod division for ints
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: yselivanov Nosy List: mark.dickinson, python-dev, serhiy.storchaka, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2016-02-08 22:31 by yselivanov, last changed 2016-02-11 15:27 by yselivanov. This issue is now closed.

Files
File name Uploaded Description Edit
mod_div.patch yselivanov, 2016-02-08 22:31 review
Messages (4)
msg259897 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-02-08 22:31
The attached patch implements fast path for modulo division of single digit longs.

Some timeit micro-benchmarks: 

-m timeit -s "x=22331" "x%2;x%3;x%4;x%5;x%6;x%7;x%8;x%99;x%100;"
with patch: 0.213 usec
without patch: 0.602 usec
msg259898 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-02-08 22:35
See also issue #21955.
msg260045 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-02-10 22:14
Is this patch is a subset of issue #26289 patch?
msg260111 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-02-11 15:27
New changeset 37bacf3fa1f5 by Yury Selivanov in branch 'default':
Issues #26289 and #26315: Optimize floor/modulo div for single-digit longs
https://hg.python.org/cpython/rev/37bacf3fa1f5
History
Date User Action Args
2016-02-11 15:27:35yselivanovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-02-11 15:27:00python-devsetnosy: + python-dev
messages: + msg260111
2016-02-10 22:14:09vstinnersetmessages: + msg260045
2016-02-09 20:13:42mark.dickinsonsetnosy: + mark.dickinson
2016-02-08 22:35:45vstinnersetmessages: + msg259898
2016-02-08 22:31:15yselivanovcreate