classification
Title: Faster bypass re cache when DEBUG is passed
Type: enhancement Stage: resolved
Components: Library (Lib), Regular Expressions Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, mrabarnett, pitrou, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2014-09-28 13:43 by serhiy.storchaka, last changed 2014-09-29 17:02 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
re_debug_cache_faster.patch serhiy.storchaka, 2014-09-28 13:43 review
Messages (3)
msg227758 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-09-28 13:43
Here is a patch which gets rid of small performance regression introduced by issue20426 patch. No need to check flags before cache lookup because patterns with the DEBUG flag are newer cached.

$ ./python -m timeit -s "import re" -- "re.match('', '')"

Before patch: 9.08 usec per loop
After patch: 8 usec per loop
msg227801 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-09-29 15:14
New changeset 565096a32ce4 by Serhiy Storchaka in branch 'default':
Issue #22510: Get rid of little overhead of testing re.DEBUG flag.
https://hg.python.org/cpython/rev/565096a32ce4
msg227810 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-09-29 17:02
Thank you Antoine for your review.
History
Date User Action Args
2014-09-29 17:02:10serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg227810

stage: patch review -> resolved
2014-09-29 15:14:32python-devsetnosy: + python-dev
messages: + msg227801
2014-09-28 13:43:11serhiy.storchakacreate