Let’s say I want to write an add-on to append sticky notes to websites. On every tabs.onUpdated
, the extension must check if there are notes to be added to the page. Should I permanently load all the stored data to addon background for quick access or should I run storage.local.get
every time?
Which one would be more efficient? Is there any way to compare execution time / memory usage / CPU usage? Or a simple answer based on how browser.storage
works.
I guess that load everything to memory would be preferable for small data, while querying the storage would be better for larger data. But what’s the inflection point?