0
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden synced 2024-11-05 23:28:57 +01:00
bitwarden_rs/src
BlackDex 3181e4e96e
Optimize CipherSyncData for very large vaults
As mentioned in #3111, using a very very large vault causes some issues.
Mainly because of a SQLite limit, but, it could also cause issue on
MariaDB/MySQL or PostgreSQL. It also uses a lot of memory, and memory
allocations.

This PR solves this by removing the need of all the cipher_uuid's just
to gather the correct attachments.

It will use the user_uuid and org_uuid's to get all attachments linked
to both, weither the user has access to them or not. This isn't an
issue, since the matching is done per cipher and the attachment data is
only returned if there is a matching cipher to where the user has access to.

I also modified some code to be able to use `::with_capacity(n)` where
possible. This prevents re-allocations if the `Vec` increases size,
which will happen a lot if there are a lot of ciphers.

According to my tests measuring the time it takes to sync, it seems to
have lowered the duration a bit more.

Fixes #3111
2023-01-11 20:23:53 +01:00
..
api Optimize CipherSyncData for very large vaults 2023-01-11 20:23:53 +01:00
db Optimize CipherSyncData for very large vaults 2023-01-11 20:23:53 +01:00
static Remove shrink-to-fit=no 2023-01-09 19:17:03 +01:00
auth.rs Resolve uninlined_format_args clippy warnings 2023-01-09 19:17:13 +01:00
config.rs Resolve uninlined_format_args clippy warnings 2023-01-09 20:13:48 +01:00
crypto.rs Remove get_random_64() 2022-11-13 10:03:06 +01:00
error.rs Cleanups and Fixes for Emergency Access 2022-12-02 09:44:23 +01:00
mail.rs Resolve uninlined_format_args clippy warnings 2023-01-09 19:17:13 +01:00
main.rs Resolve uninlined_format_args clippy warnings 2023-01-09 19:17:13 +01:00
ratelimit.rs Basic ratelimit for user login (including 2FA) and admin login 2021-12-22 21:48:49 +01:00
util.rs Resolve uninlined_format_args clippy warnings 2023-01-09 19:17:13 +01:00