[issue34925] 25% speed-up to common case bisect()

2018-10-07 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +9139 stage: -> patch review ___ Python tracker ___ ___ Python-bug

[issue34925] 25% speed-up to common case bisect()

2018-10-07 Thread Raymond Hettinger
New submission from Raymond Hettinger : The common case for bisect calls is to have two positional arguments and no keyword arguments. For this case, PyArg_ParseTupleAndKeywords() is unnecessarily expensive. Timings --- $ pytime -r 11 -s 'from bisect import bisect' -s 'arr=list(range(5)