This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Faster bypass re cache when DEBUG is passed
Type: enhancement Stage: resolved
Components: Library (Lib), Regular Expressions Versions: Python 3.5
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 2022-04-11 14:58 by admin. This issue is now closed.

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.
msg227810 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-09-29 17:02
Thank you Antoine for your review.
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66700
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