Closed Bug 1878312 Opened 8 months ago Closed 4 months ago

Deleting an Indexed DB object store can take tens of minutes

Categories

(Core :: Storage: IndexedDB, defect)

Firefox 122
x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1860486

People

(Reporter: andybalaam, Unassigned)

Details

Attachments

(1 file)

4.20 KB, application/x-javascript
Details
Attached file firefox-testcase.js

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?

OS: Unspecified → Linux
Hardware: Unspecified → x86_64

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!

Component: Untriaged → Storage: IndexedDB
Product: Firefox → Core
Flags: needinfo?(jjalkanen)

: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!

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.

Flags: needinfo?(jjalkanen)

Confirmed that this is fixed in 124.0.2. Thank you!

Status: UNCONFIRMED → RESOLVED
Closed: 4 months ago
Duplicate of bug: 1860486
Resolution: --- → DUPLICATE

(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!

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

Attachment

General

Creator:
Created:
Updated:
Size: