Message324277
I have found that using timeout with a python queue.Queue() results in an average delay of 14.5ms in Windows over Ubuntu in python 3.6.5/3.7, I subtracted the 1 ms timeout.
I have also tried datetime.datetime.now() to measure the time, with similar results.
Does that make sense?
import queue
import time
max=0
min=10000
num = 10000
sum = 0
for x in range(10000):
q = queue.Queue()
start = time.perf_counter()
try:
msg = q.get(block=True, timeout=.001)
except:
end = time.perf_counter()
chng = end-start -.001
if chng > max:
max = chng
if chng < min:
min = chng
sum = sum + chng
print(f"Avg: {sum/num}")
print(f"Min: {min}")
print(f"Max: {max}")
Results:
Window 10, Python 3.6.5/3.7
Avg: 0.014549868429997701
Min: 0.001674142000000046
Max: 0.13890251500000284
Ubuntu 16.04, Python 3.6.5/3.7
Avg: 6.275181290839012e-05
Min: 4.89290034456644e-05
Max: 8.690999695681965e-05 |
|
Date |
User |
Action |
Args |
2018-08-28 19:20:21 | Gammaguy | set | recipients:
+ Gammaguy, paul.moore, tim.golden, zach.ware, steve.dower |
2018-08-28 19:20:21 | Gammaguy | set | messageid: <1535484021.65.0.56676864532.issue34535@psf.upfronthosting.co.za> |
2018-08-28 19:20:21 | Gammaguy | link | issue34535 messages |
2018-08-28 19:20:21 | Gammaguy | create | |
|