Paulowarren31 / Supreme-Bot

supreme bot anyone can use for free!
https://chrome.google.com/webstore/detail/ez-preme/pifcojpimhgdcegdfohnmjmbpiiphghi
MIT License
86 stars 32 forks source link

Very High CPU Usage #45

Open blasian opened 7 years ago

blasian commented 7 years ago

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