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.

classification
Title: re compilation slow in Python 3.3 due to functools.lru_cache overhead
Type: performance Stage: needs patch
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench
View: 16389
Assigned To: Nosy List: brett.cannon, pjenvey
Priority: normal Keywords:

Created on 2012-11-02 18:34 by brett.cannon, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg174554 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-11-02 18:34
The Mako developers discovered that under Python 3.3 their library under the mako_v2 benchmark went from 2.95x slower than Python 2.7 to 1.25x slower by simply avoiding an re compilation: http://www.makotemplates.org/trac/changeset/c1468b12f115ac9e469150ce24ea042aeae5e270

Their profiling showed that functools.lru_cache in rc._compiled_typed was a major contributor: http://paste.ofcode.org/yZRKnJfTsHesFR8hMWfc7f
msg174555 - (view) Author: Philip Jenvey (pjenvey) * (Python committer) Date: 2012-11-02 18:36
Sorry Brett, beat you to it w/ #16389 =P
History
Date User Action Args
2022-04-11 14:57:38adminsetgithub: 60594
2012-11-03 01:30:57ncoghlansetsuperseder: re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench
2012-11-02 18:36:49pjenveysetstatus: open -> closed
resolution: duplicate
messages: + msg174555
2012-11-02 18:34:24brett.cannoncreate