Open Bug 1884045 Opened 2 years ago Updated 1 year ago

Throttle old notification storage mechanism in NotificationDB.sys.mjs

Categories

(Core :: DOM: Notifications, enhancement)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: hsingh, Assigned: hsingh)

References

Details

Throttle old notification storage mechanism in NotificationDB.sys.mjs. Potentially, store notifications only after 10s have been elapsed since the last one or shutdown is requested.

But this is not old storage specific, right? kvstore also has the same problem as each write operation also calls commit().

Yes, technically rkv would have the same issue but their implementation might be much more performant than our old naive implementation because we delete and create a new notificationstore for every new notification. I am not sure how rkv does here but I would assume their implementation to be much more sophisticated.

By delete and create I guess you mean the stored file. Rkv also does the same.

yes, I was referring to notificationstorage.json. I thought rkv backend would match more closely to databases. I guess it's probably not meant for high frequency write transactions then. Throttling might not be necessary for notifications at all. Release channels are still using the old implementation and we never got any complaints about the performance. Because, realistically i think we could only have few notifications per second which isn't very hard to keep up for both implementations.

rkv was originally designed to use LMDB which is a memory-mapped key-value store that would not suffer from write multiplication, but it caused a bunch of inexplicable crashes, hence adoption of the safe mode that serializes the entire state to file.

Component: DOM: Push Subscriptions → DOM: Notifications
You need to log in before you can comment on or make changes to this bug.