Seeking regex optimizer

Paddy paddy3118 at netscape.net
Sun Jun 18 18:45:59 EDT 2006


Kay Schluehr wrote:
<SNIP>
> with reverse sorting as in your proposal.The naive solution is easy to
> generate but I'm sceptical about its cost effectiveness. On the other
> hand I do not want to investigate this matter if somebody else already
> did it thoroughly.
>
> Regards,
> Kay

Hi Kay,
The only way to know if something is optimised enough, is for you to
test it in your application.  If you haven't finished your application,
then don't sweat it. take a note of your options, stick one in, then
get the application finished.
Its only when its finished that you can really say if further
optimisations are necessary, and you would have to profile the complete
prog to see where it's spending its time.

I usually find myself using string methods where possible, then regular
expressions only for things that string methods cannot do. When I
finish my script I usually find that Pythons speed is adequate for most
of my text processing tasks, or if speed IS an issue, then i needed to
profile the completed application anyway.

- Pad.




More information about the Python-list mailing list