[New-bugs-announce] [issue26315] Optimize mod division for ints

Yury Selivanov report at bugs.python.org
Mon Feb 8 17:31:15 EST 2016

New submission from Yury Selivanov:

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

assignee: yselivanov
components: Interpreter Core
files: mod_div.patch
keywords: patch
messages: 259897
nosy: haypo, serhiy.storchaka, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Optimize mod division for ints
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file41861/mod_div.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list