[merge] lazy regex

John Arbash Meinel john at arbash-meinel.com
Mon Oct 9 10:46:37 BST 2006


The attached patch adds a new class and function, which allows us to
create a lazy compiling regex class. It should be robust enough to
actually replace re.compile() (and helper functions are provided to do
just that).

The proxy object is designed to have a minimal amount of overhead after
it has been activated. Which it does by setting the local attributes to
the values of the compiled regex object.

I'd like to get this merged, since it has a very specific use when
importing elementtree, which allows us to avoid 20-30ms of startup
overhead for commands like 'status' and 'diff'. (I already avoid it for
'bzr rocks' because we don't need to do any xml parsing).

John
=:->
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lazy_regex.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20061009/5b94f55e/attachment.diff 


More information about the bazaar mailing list