Throttle old notification storage mechanism in NotificationDB.sys.mjs
Categories
(Core :: DOM: Notifications, enhancement)
Tracking
()
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.
Comment 1•2 years ago
|
||
But this is not old storage specific, right? kvstore also has the same problem as each write operation also calls commit().
| Assignee | ||
Comment 2•2 years ago
|
||
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.
Comment 3•2 years ago
•
|
||
By delete and create I guess you mean the stored file. Rkv also does the same.
| Assignee | ||
Comment 4•2 years ago
|
||
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.
Comment 5•2 years ago
|
||
👍
Comment 6•2 years ago
|
||
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.
Updated•2 years ago
|
Description
•