raucao / webmarks

remoteStorage-enabled bookmarking app
https://webmarks.5apps.com
Other
76 stars 11 forks source link

Make Webmarks less active if not focused #65

Closed benrubson closed 6 years ago

benrubson commented 6 years ago

Hi,

Even if in a background/hidden tab, so not focused, Webmarks regularly updates itself :

screen shot 2018-05-02 at 10 59 38

Thus making it a top energy consumer on a laptop.

Could it be possible to make it less active / not active while not focused ?

Thank you very much 👍

Ben

raucao commented 6 years ago

Those requests are normal sync requests, which are tiny and don't take up much energy at all. And actually, while the app is the background, they should be reduced from a 10-second interval to a 60-second interval. So it should actually already be doing that 6 times less when the app is in the background.

Personally, I wouldn't keep the Webmarks tab open in the background at all, when it's not necessary. The app is optimized to start up really fast once connected and synced, so you can just open it quickly whenever you want to access bookmarks or add a new one (the latter ideally from the bookmarklet).

I'll close this one, because although there may still be a memory leak, as described in #44, these requests are actually not an issue for energy consumption.

benrubson commented 6 years ago

Those requests (...) are tiny and don't take up much energy at all.

Actually they do, as per Mac OS energy monitor. Perhaps this is related to the number of saved bookmarks.

I wouldn't keep the Webmarks tab open in the background at all

I keep it opened in the first pinned tab of my browser, which is really convenient when regularly using bookmarks.

Perhaps we could disable background refresh, and simply add a sync operation when Webmarks get re-focused ? This would also reset the 10 seconds timeout, so that subsequent sync would fire 10 seconds later.

Thank you 👍

raucao commented 6 years ago

The requests are literally a handful of bytes, with an empty 304 response. Could you please show me how it's those requests, and not anything else, that is using up energy?

benrubson commented 6 years ago

screen shot 2018-05-02 at 11 40 31

I see those numbers for some time, on a 10 / 60 seconds basis, as you described above. Perhaps that in addition to the AJAX requests, there is some more JS running.

I think it would be interesting to make Webmarks lightweight :)

benrubson commented 6 years ago

Perhaps we could disable background refresh, and simply add a sync operation when Webmarks get re-focused ? This would also reset the 10 seconds timeout, so that subsequent sync would fire 10 seconds later.

What about this idea ? Thank you very much Sebastian !