core.runner: optimize the waiting for early test status
The loop that waits for the early test status has a call to sleep(0), which
turns it into an almost busy-loop. Changing it to sleep(0.01) consumes less CPU
without performance degradation (might actually make things run faster according
to my tests).
This change also makes it more consistent with the similar loop
for the actual test status.
On my machine, before this change running "passtest.py" 100 times would result
in almost 250000 calls to time.sleep(). After the change, the number gets down
to 600 (tracked via python cProfile module).
Signed-off-by: NAdemar de Souza Reis Jr <areis@redhat.com>
Showing
想要评论请 注册 或 登录