bring back loop + relax cpu to perf test

pull/39/head
Ciro 2022-11-06 07:18:48 -03:00
rodzic fd14510032
commit ab81096f6f
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -60,12 +60,12 @@ class Loop:
callback(user_data) callback(user_data)
loop.queue.task_done() loop.queue.task_done()
#run once asyncio if has some current task running or relax CPU #run once asyncio if has some current task running or relax CPU
if not asyncio.current_task(loop.loop) is None or loop.last_run >= 100: if not asyncio.current_task(loop.loop) is None or loop.last_run >= 10:
loop.run_once_asyncio() loop.run_once_asyncio()
loop.last_run = 0 loop.last_run = 0
loop.last_run = loop.last_run + 1 loop.last_run = loop.last_run + 1
#use check for calling asyncio once per tick #use check for calling asyncio once per tick
self.timer = self.uv_loop.create_timer(1, 0, tick, self) self.timer = self.uv_loop.create_timer(0, 1, tick, self)
# self.timer = self.uv_loop.create_check(tick, self) # self.timer = self.uv_loop.create_check(tick, self)
def run(self): def run(self):