Testcase generating/storing N empty strings in sessionstorage is 4x slower for N=500K
Categories
(Core :: Storage: localStorage & sessionStorage, enhancement)
Tracking
()
People
(Reporter: mayankleoboy1, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug)
Attachments
(1 file)
|
1.07 KB,
text/html
|
Details |
Open attached testcase
Enter 500K and click on store
500K
Nightly: https://share.firefox.dev/3XkpSdg (15s)
Chrome: https://share.firefox.dev/4h30U9B (4s)
Testcase generated by chatgpt on my prompts. The testcase is unrealistic, but maybe it highlights some hotspots?
Comment 1•1 year ago
|
||
One low hanging fruit here is probably to do aWriteInfos.EnsureCapacity before entering this loop.
There could be a further optimization for how we sort here, IIUC we always start from an empty set and add all available items immediately, so sorting just once afterwards would be more efficient.
Updated•1 year ago
|
Comment 2•1 year ago
|
||
Yes, that sounds like a good plan.
| Reporter | ||
Comment 3•6 months ago
|
||
(In reply to Jens Stutte [:jstutte] from comment #1)
One low hanging fruit here is probably to do
aWriteInfos.EnsureCapacitybefore entering this loop.There could be a further optimization for how we sort here, IIUC we always start from an empty set and add all available items immediately, so sorting just once afterwards would be more efficient.
This still repros.
Worth biting the bullet and fixing the low-hanging stuff in a separate bug now for some easy wins?
Description
•