Message132208
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 |
|
Date |
User |
Action |
Args |
2011-03-26 01:45:12 | v+python | set | recipients:
+ v+python, lemburg, terry.reedy, tzot, amaury.forgeotdarc, pitrou, vstinner, christian.heimes, tim.golden, mark, christoph, ezio.melotti, hippietrail, ssbarnea, davidsarah, santoso.wijaya, David.Sankel |
2011-03-26 01:45:12 | v+python | set | messageid: <1301103912.62.0.305766548059.issue1602@psf.upfronthosting.co.za> |
2011-03-26 01:45:12 | v+python | link | issue1602 messages |
2011-03-26 01:45:11 | v+python | create | |
|