Open Bug 1950816 Opened 1 year ago Updated 6 months ago

Testcase generating/storing N empty strings in sessionstorage is 4x slower for N=500K

Categories

(Core :: Storage: localStorage & sessionStorage, enhancement)

enhancement

Tracking

()

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

Attached file Sessionstorage.html

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?

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.

Yes, that sounds like a good plan.

Blocks: 1980560
See Also: 1943230

(In reply to Jens Stutte [:jstutte] from comment #1)

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.

This still repros.
Worth biting the bullet and fixing the low-hanging stuff in a separate bug now for some easy wins?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: