Author v+python
Recipients David.Sankel, amaury.forgeotdarc, christian.heimes, christoph, davidsarah, ezio.melotti, hippietrail, lemburg, mark, pitrou, santoso.wijaya, sorin, terry.reedy, tim.golden, tzot, v+python, vstinner
Date 2011-03-26.01:45:11
SpamBayes Score 4.26893e-07
Marked as misclassified No
Message-id <1301103912.62.0.305766548059.issue1602@psf.upfronthosting.co.za>
In-reply-to
Content
David-Sarah said:
In any case, given that the buffer of the initial std{out,err} will always be a BufferedWriter object (since .buffer is readonly), it would be possible for the TextIOWriter to test a dirty flag in the BufferedWriter, in order to check efficiently whether the buffer needs flushing on each write. I've looked at the implementation complexity cost of this, and it doesn't seem too bad.

So if flush checks that bit, maybe TextIOWriter could just call buffer.flush, and it would be fast if clean and slow if dirty?  Calling it at the beginning of a Text level write, that is, which would let the char-at-a-time calls to buffer.write be fast.

And I totally agree with msg132191
History
Date User Action Args
2011-03-26 01:45:12v+pythonsetrecipients: + v+python, lemburg, terry.reedy, tzot, amaury.forgeotdarc, pitrou, vstinner, christian.heimes, tim.golden, mark, christoph, ezio.melotti, hippietrail, sorin, davidsarah, santoso.wijaya, David.Sankel
2011-03-26 01:45:12v+pythonsetmessageid: <1301103912.62.0.305766548059.issue1602@psf.upfronthosting.co.za>
2011-03-26 01:45:12v+pythonlinkissue1602 messages
2011-03-26 01:45:11v+pythoncreate