Message101120
With line buffering, I see the issue.
* 6 s without thread
* 115 s with the spinning thread (varying: 60 s, 98 s)
* 16 s with the spinning thread and the last "gilinter.patch"
# Modified version of the test case, with bufsize=1
from threading import Thread
import time
def writenums(f, n):
start = time.time()
for x in range(n):
f.write("%d\n" % x)
end = time.time()
print(end-start)
def spin():
while True:
pass
t1 = Thread(target=spin)
t1.daemon=True
# Uncomment to add a thread
#t1.start()
# With line buffering
writenums(open("./nums", "w", 1), 1000000) |
|
Date |
User |
Action |
Args |
2010-03-15 15:44:42 | flox | set | recipients:
+ flox, loewis, jhylton, pitrou, eric.smith, kevinwatters, tarek, karld, carljm, coderanger, alex, brian.curtin, DazWorrall, rh0dium, rcohen, dabeaz, mahmoudimus |
2010-03-15 15:44:42 | flox | set | messageid: <1268667882.31.0.71789595284.issue7946@psf.upfronthosting.co.za> |
2010-03-15 15:44:40 | flox | link | issue7946 messages |
2010-03-15 15:44:40 | flox | create | |
|