Deleting an Indexed DB object store can take tens of minutes
Categories
(Core :: Storage: IndexedDB, defect)
Tracking
()
People
(Reporter: andybalaam, Unassigned)
Details
Attachments
(1 file)
4.20 KB,
application/x-javascript
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0
Steps to reproduce:
Created and used a large Indexed DB store (200K records, with keys ~100 characters and values ~1000 bytes, 1 index).
Then deleted it during a schema upgrade using deleteObjectStore().
Actual results:
It took several hours for the operation to complete.
Expected results:
I would expect deleting an object store to be fast.
This hit us in real life first: https://github.com/element-hq/element-web/issues/26948
So I wrote some benchmarks to figure out what was going wrong and wrote them up in a blog post here: https://www.artificialworlds.net/blog/2024/02/02/deleting-an-indexed-db-store-can-be-incredibly-slow-on-firefox/ . Conclusion: large, indexed object stores can take 20 minutes or longer to delete. Clearing them first makes it faster but still very slow (over 5 minutes). The code for the benchmark is here: https://codeberg.org/andybalaam/indexed-db-perf
I then tried to create a simple testcase, and, frustratingly, am not seeing the same results there. I attached my code for the simple testcase.
I don't know why the simple testcase is not producing the same slowness. Maybe we need to create many object stores before we start seeing this problem?
Reporter | ||
Updated•8 months ago
|
Comment 1•4 months ago
|
||
Moving this to Core > Storage: IndexedDB component to allow our engineers to examine it more closely. If this is not the right component, please move it to a more appropriate one. Thanks!
Updated•4 months ago
|
Comment 2•4 months ago
|
||
:smaug points out that this was filed against Fx122 and a performance improvement for indices was landed in Fx123 as part of bug 1860486, so hopefully Jari already fixed this!
Comment 3•4 months ago
|
||
Thank you for the test case! It reports now an average of 900 milliseconds on a developer machine so it appears that the fix was applicable also to this case.
Reporter | ||
Comment 4•4 months ago
|
||
Confirmed that this is fixed in 124.0.2. Thank you!
Updated•4 months ago
|
Comment 6•4 months ago
|
||
(In reply to Andy Balaam from comment #4)
Confirmed that this is fixed in 124.0.2. Thank you!
Thanks for confirming and your support!
Description
•