Message149560
> Line-buffering should be good enough since in practice errors messages
> are always terminated by a newline.
What I think too.
> I'm hesitant to make it line-buffered by default when directed to a
> file, since this could significantly slow down a program that for some
> reason produces super-voluminous output (e.g. when running a program
> with heavy debug logging turned on).
The slow-down is impressive in relative terms (6x) but the timings are
still small in absolute value:
$ ./python -m timeit -s "f=open('/dev/null', 'a', buffering=4096)" "f.write('log message\n')"
10000000 loops, best of 3: 0.156 usec per loop
$ ./python -m timeit -s "f=open('/dev/null', 'a', buffering=1)" "f.write('log message\n')"
1000000 loops, best of 3: 0.961 usec per loop |
|
Date |
User |
Action |
Args |
2011-12-15 14:27:02 | pitrou | set | recipients:
+ pitrou, gvanrossum, gjb1002, pjenvey, benjamin.peterson, stutzbach |
2011-12-15 14:27:01 | pitrou | link | issue13601 messages |
2011-12-15 14:27:01 | pitrou | create | |
|