cgi.py performance

Gustavo Cordova gcordova at hebmex.com
Thu Apr 4 16:00:32 EST 2002


> 
> Hey, that looks pretty cool.  I do have one question before I 
> try it out: in
> mime.py, Entity.__init()__, which splits up the data on the 
> boundaries,
> loads the entire file at once, if I am not mistaken ("msg = 
> fp.read()").
> What will happen if I am transferring a very large file, 50-100MB?
> 
> Thanks,
> Jim
> 

Well, for a moment there, you're gonna have instances
of huge strings, really.

A good multipart/form-data parser should never load
the whole data into memory at once, but load it up
in small chunks while splitting and parsing it.

I once had a C module that did precisely that,
both with url-encoded and with multipart/form-data,
except I can't remember what I did with that.

Anyhow, it's perfectly doable from python, also.

-gustavo





More information about the Python-list mailing list