Supreme-Bot icon indicating copy to clipboard operation
Supreme-Bot copied to clipboard

Very High CPU Usage

Open blasian opened this issue 7 years ago • 0 comments

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

blasian avatar Oct 26 '17 06:10 blasian