At 01:07 PM 10/6/2007 +1000, René Dudfield wrote: >I think 'streaming' is good for speeding up web pages when processing >takes a while. > >I'll explain why... > >Say your page takes 0.2 seconds to process. > >If you wait until 0.2 seconds is up, then the first bytes that will >come to the browser will arrive in at least 0.2 seconds. Whereas if >you send data as soon as its ready, then the user will be able to see >some of that data more quickly - and possibly make more requests >sooner.
It's faster for the user, but not necessarily for the server. The server will do more system calls, and the CPU will do more context switches. So, if you're going to stream for purposes of responsiveness, you're going to be trading off against overall server throughput. Nonetheless, the pages where you even have the choice of streaming are infrequent. Most of the examples I see of people doing streaming are completely worthless, because there isn't any non-trivial computation taking place between the yields. _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com