Python example: possible speedup?

Hrvoje Niksic hniksic at srce.hr
Wed Sep 8 13:31:11 EDT 1999


Skip Montanaro <skip at mojam.com> writes:
[...]

Thanks for your comments.  The package files aren't *humongous*, but
they aren't exactly small either.  One file is 700K, and the other is
3M large.  It would be really nice if it were possible to process them
in a stream.

But I'll try it, for the sake of argument, and see if the speedup is
worth it.

> Also, instead of calling next_header on a line-by-line basis, how
> about calling it once per package and returning a dict containing
> the header names as keys?

I'll try this too, and get back to you.  That change will actually
make the code more correct because it will no longer assume that
`Package' header comes before `Status' and `Installed-Size' headers.




More information about the Python-list mailing list