I'm clocking at over 100% cpu usage when the app is "waiting". I think this has to do with the amount of request per second being sent in the worker class.
Correct me if I'm mistaken but it seems redundant for the worker to be listening on a websocket through an EventListener AND listening for messages through self.OnMessage? These should be bundled into a single callback so the worker doesn't need to send messages to itself hundreds of times per second.
I'm clocking at over 100% cpu usage when the app is "waiting". I think this has to do with the amount of request per second being sent in the worker class.
Correct me if I'm mistaken but it seems redundant for the worker to be listening on a websocket through an EventListener AND listening for messages through self.OnMessage? These should be bundled into a single callback so the worker doesn't need to send messages to itself hundreds of times per second.
https://github.com/Paulowarren31/Supreme-Bot/blob/3780e576c4bc7160ef5098752e71d4f832d48831/background.js#L137
https://github.com/Paulowarren31/Supreme-Bot/blob/3780e576c4bc7160ef5098752e71d4f832d48831/worker.js#L1