Skip to content
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: more efficient serialization format #3645

Merged
merged 7 commits into from
Jul 3, 2024

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jul 3, 2024

The current serialization format that we use for most objects in the indexeddb crypto store is extremely space-inefficient, leading to poor performance and errors (cf element-hq/element-web#27658).

The idea here is to switch to the more efficient format used by maybe_encrypt_value. To avoid a huge migration step, we make the deserialization routine handle either format.

@richvdh richvdh requested a review from a team as a code owner July 3, 2024 12:16
@richvdh richvdh requested review from andybalaam and removed request for a team July 3, 2024 12:16
Copy link
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Hoping for big performance improvements.

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.20%. Comparing base (5d716f9) to head (4d12a78).
Report is 26 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3645   +/-   ##
=======================================
  Coverage   84.19%   84.20%           
=======================================
  Files         256      256           
  Lines       26600    26600           
=======================================
+ Hits        22397    22399    +2     
+ Misses       4203     4201    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

richvdh added 7 commits July 3, 2024 14:10
I'm going to change the behaviour of `serialize_value`, and we want to preserve
the behaviour of this test.
... and make `deserialize_value` handle both the old and new formats.

`maybe_encrypt_value` uses a much more efficient representation, so let's
migrate to that.
Now that `deserialize_value` returns an `IndexeddbCryptoStoreError`, we don't
need these any more.
@richvdh richvdh force-pushed the rav/indexeddb_storage_efficiency branch from 0440722 to 4d12a78 Compare July 3, 2024 13:11
@richvdh richvdh enabled auto-merge July 3, 2024 13:12
@richvdh richvdh merged commit c4413c6 into main Jul 3, 2024
38 checks passed
@richvdh richvdh deleted the rav/indexeddb_storage_efficiency branch July 3, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants