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 ezio.melotti
Recipients barry, ezio.melotti, loewis, nadeem.vawda, orsenthil, r.david.murray, rosslagerwall, serhiy.storchaka
Date 2012-09-19.20:09:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1348085390.37.0.616956670035.issue11454@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, however it has a startup cost that the function that returns re.search(short_regex, s) and the one with functool.partial don't have, because with these the compilation happens at the first call.

If we use one of these two, the startup time will be reduced a lot, and the runtime will be ~2x faster.
If we use re.compile(short_regex).search the startup time won't be reduced as much, but the runtime will be ~8x faster.

Given that here we are trying to reduce the startup time and not the runtime, I think using one of those two functions is better.

Another possible solution to improve the startup time is trying to optimize _optimize_unicode -- not sure how much can be done there though.
History
Date User Action Args
2012-09-19 20:09:50ezio.melottisetrecipients: + ezio.melotti, loewis, barry, orsenthil, nadeem.vawda, r.david.murray, rosslagerwall, serhiy.storchaka
2012-09-19 20:09:50ezio.melottisetmessageid: <1348085390.37.0.616956670035.issue11454@psf.upfronthosting.co.za>
2012-09-19 20:09:49ezio.melottilinkissue11454 messages
2012-09-19 20:09:49ezio.melotticreate