Python example: possible speedup?
Hrvoje Niksic
hniksic at srce.hr
Fri Sep 10 14:11:13 EDT 1999
"Tim Peters" <tim_one at email.msn.com> writes:
> Was the Perl code to which you're comparing it as general as your
> Python code?
The Perl code was almost equivalent to the first posted version of
Python code -- the only important difference is that it used a
functional approach rather than OOP. I can mail it to you if you are
curious.
Generality is important to me because another day I might wish to do
something else with those files, like draw a tree of dependencies, or
something. In that case, I'd surely want to reuse the existing
reader/parser. Speed is good, but not so good to justify loss of code
reuse.
Robert's solution is ideologically similar to the `grep' solution
proposed below.
More information about the Python-list
mailing list