From ab81096f6f77a944758f54ea024dd60d92c6d7fd Mon Sep 17 00:00:00 2001 From: Ciro Date: Sun, 6 Nov 2022 07:18:48 -0300 Subject: [PATCH] bring back loop + relax cpu to perf test --- src/socketify/loop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/socketify/loop.py b/src/socketify/loop.py index f0815d6..71aafe3 100644 --- a/src/socketify/loop.py +++ b/src/socketify/loop.py @@ -60,12 +60,12 @@ class Loop: callback(user_data) loop.queue.task_done() #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.last_run = 0 loop.last_run = loop.last_run + 1 #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) def run(self):