[Twisted-Python] re: Congrats / a little newbie confusion
peter at engcorp.com
Fri Apr 4 14:08:06 EST 2003
Jeffrey Mathews wrote:
> As for Peter's question about the need for a CGI.FieldStorage type api, it's
> really only an issue when you're doing huge multipart mime posts (e.g., file
> uploads). The idea of passing around those results (potentially multi
> megabyte) as strings is kind of frightening. That said, I have no grasp on
> what issues are raised when handling these things asynchronously (the cgi
> module is all synchronous).
What is it about passing around multi-megabyte data as strings that scares
you? The data is only needed temporarily, I would think, until it is written
to a file. Servers have gobs of memory, and massive file uploads are
rare... or if they're not, surely the server can have adequate capacity
to handle the load (memory-wise).
Maybe I'm too naive, but unless I was expecting, say, greater than 10MB
or 20MB files on a regular basis, I wouldn't think twice about just using
strings. Much simpler than trying to juggle temporary files and references
to them and removing them when appropriate etc.
Is your concern a case of premature optimization?
More information about the Twisted-Python