NEWBIE: ishexdigit revisited
kirk at strauser.com
Tue Dec 30 23:05:05 CET 2003
-----BEGIN PGP SIGNED MESSAGE-----
At 2003-12-30T21:45:13Z, Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:
> You're using an extreme example and seeing the cost of the cache lookup in
> the first example.
The OP may be coding in an extreme situation. Given the free performance
gain without requiring any more work, resources, or syntax, I can't think of
a good reason *not* to pre-compile any regexp used more than a few times.
> You're certainly not seeing the pattern get recompiled a million times in
> 5 seconds. Doing would be many times slower.
Regardless of the cause, there's still a 400% increase in overhead in my
example by not pre-compiling the pattern.
The Strauser Group
Open. Solutions. Simple.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Python-list