tomouchuu / mastodon-translate

Tampermonkey Script to add option to Translate Toots
The Unlicense
24 stars 2 forks source link

Script will use a lot of CPU if page is left open #4

Closed tomouchuu closed 7 years ago

tomouchuu commented 7 years ago

If you leave the feed up with the script running it can use a lot of CPU since we're running the script every second on that page. For the moment I've bumped this up to 60seconds with 85674bfe6165cd3c98c2f40fcada800751e20f23 but ideally I want a better solution that just listens for new toots.

tomouchuu commented 7 years ago

We're down to 30seconds and considering lowering it further to 10seconds, I think until a better solution it's going to be a fine line between more toots and CPU usage.

tomouchuu commented 7 years ago

Just a thought to consider. Rather than having the whole script on a setInterval, I wonder what the delay/any implications would be to listen for all clicks to any (...) and then add in the translate option?