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.

Author serhiy.storchaka
Recipients christian.heimes, ezio.melotti, flox, gvanrossum, mrabarnett, neologix, pitrou, serhiy.storchaka
Date 2013-10-28.11:50:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382961013.7.0.168343623052.issue17441@psf.upfronthosting.co.za>
In-reply-to
Content
I'm surprised, but perhaps performance benefit actually exists (check this on other computers).

### regex_effbot ###
Min: 0.333525 -> 0.325349: 1.03x faster
Avg: 0.342451 -> 0.331665: 1.03x faster
Significant (t=12.13)
Stddev: 0.00606 -> 0.00651: 1.0738x larger

However the main benefit is that non-cached constructor (re.compile is a constructor of regular expression object) is expected to be non-cached, while other module level functions can be cached. See for example struct.Struct. We can cache non-cached constructor explicitly (as in fnmatch), but when a constructor already cached, adding new cache can only add overhead.
History
Date User Action Args
2013-10-28 11:50:13serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, pitrou, christian.heimes, ezio.melotti, mrabarnett, flox, neologix
2013-10-28 11:50:13serhiy.storchakasetmessageid: <1382961013.7.0.168343623052.issue17441@psf.upfronthosting.co.za>
2013-10-28 11:50:13serhiy.storchakalinkissue17441 messages
2013-10-28 11:50:13serhiy.storchakacreate