[New-bugs-announce] [issue19329] Faster compiling of big charset regexpes

Serhiy Storchaka report at bugs.python.org
Mon Oct 21 14:01:18 CEST 2013


New submission from Serhiy Storchaka:

Here is a patch which speed up compiling of regular expressions with big charsets.

Microbenchmark:
$ ./python -m timeit "from sre_compile import compile; r = '[%s]' % ''.join(map(chr, range(256, 2**16, 255)))"  "compile(r, 0)"

Unpatched (but with fixed issue19327): 119 msec per loop
Patched: 59.6 msec per loop

Compiling regular expressions with big charset was main cause of slowing down importing the email.message module (issue11454).

----------
assignee: serhiy.storchaka
components: Library (Lib), Regular Expressions
files: re_mk_bitmap.patch
keywords: patch
messages: 200755
nosy: ezio.melotti, haypo, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Faster compiling of big charset regexpes
type: performance
versions: Python 3.4
Added file: http://bugs.python.org/file32278/re_mk_bitmap.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19329>
_______________________________________


More information about the New-bugs-announce mailing list