Optimized Favicon downloading #1509

Closed
opened 2026-04-06 01:58:58 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @BlackDex on 8/4/2023

Some optimizations in regards to downloading Favicon's.

I also encounterd some issues with accessing some sites where the connection got dropped or closed early. This seems a reqwest/hyper thingy, https://github.com/hyperium/hyper/issues/2136. This is now also fixed.

General:

  • Decreased struct size (reduces memory usage)
  • Decreased memory allocations (faster HTML parsing)
  • Optimized tokenizer a bit more to only emit tags when all attributes are there and are valid.

reqwest/hyper connection issue:
The following changes helped solve the connection issues to some sites. The endresult is that some icons are now able to be downloaded always instead of sometimes.

  • Enabled some extra reqwest features, deflate and native-tls-alpn (Which do not bring in any extra crates since other crates already enabled them, but they were not active for Vaultwarden it self)
  • Configured reqwest to have a max amount of idle pool connections per host
  • Configured reqwest to timeout the idle connections in 10 seconds
*Originally created by @BlackDex on 8/4/2023* Some optimizations in regards to downloading Favicon's. I also encounterd some issues with accessing some sites where the connection got dropped or closed early. This seems a reqwest/hyper thingy, https://github.com/hyperium/hyper/issues/2136. This is now also fixed. General: - Decreased struct size (reduces memory usage) - Decreased memory allocations (faster HTML parsing) - Optimized tokenizer a bit more to only emit tags when all attributes are there and are valid. reqwest/hyper connection issue: The following changes helped solve the connection issues to some sites. The endresult is that some icons are now able to be downloaded always instead of sometimes. - Enabled some extra reqwest features, `deflate` and `native-tls-alpn` (Which do not bring in any extra crates since other crates already enabled them, but they were not active for Vaultwarden it self) - Configured reqwest to have a max amount of idle pool connections per host - Configured reqwest to timeout the idle connections in 10 seconds
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#1509