search speed

Tim Rowe digitig at gmail.com
Fri Jan 30 09:14:07 EST 2009


2009/1/30 Diez B. Roggisch <deets at nospam.web.de>:

> No. Because nobody can automagically infer whatever structure your files
> have.

Just so. But even without going to a full database solution it might
be possible to make use of the flat file structure. For example, does
the "LF01" have to appear at a specific position in the input line? If
so, there's no need to search for it in the complete line. *If* there
is any such structure then a compiled regexp search is likely to be
faster than just 'if "LF01" in line', and (provided it's properly
designed) provides a bit of extra insurance against false positives.

-- 
Tim Rowe



More information about the Python-list mailing list