-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
indexeddb: Clear the object store before deleting it #3090
indexeddb: Clear the object store before deleting it #3090
Conversation
Since my investigation found that it significantly speeds up deletion of a store on both Firefox and Chromium if you clear() it first, do that in our migration code.
124c9eb
to
916e85f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3090 +/- ##
=======================================
Coverage 83.71% 83.71%
=======================================
Files 224 224
Lines 23497 23497
=======================================
Hits 19671 19671
Misses 3826 3826 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
Including getting the latest matrix-rust-sdk, providing: * [indexeddb: Clear the object store before deleting it #3090](matrix-org/matrix-rust-sdk#3090) which speeds up the schema upgrade v8 to v10 (see element-hq/element-web#26948 ).
@@ -317,6 +317,11 @@ async fn prepare_data_for_v7(serializer: &IndexeddbSerializer, db: &IdbDatabase) | |||
} | |||
} | |||
|
|||
// We have finished with the old store. Clear it, since it is faster to | |||
// clear+delete than just delete. See https://www.artificialworlds.net/blog/2024/02/01/deleting-an-indexed-db-store-can-be-incredibly-slow-on-firefox/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is a 404 :-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the author of the blog is to blame: https://www.artificialworlds.net/blog/2024/02/02/deleting-an-indexed-db-store-can-be-incredibly-slow-on-firefox/.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #3094
Since my investigation found that it significantly speeds up deletion of a store on both Firefox and Chromium if you clear() it first, do that in our migration code.
Related: element-hq/element-web#26948