servo/components
Sebastian C 27c8a899ea
Replace hsts preload list hashmap with an FST (#37015)
This reduces the memory used by the preload list to just 1.9MB. The
total memory savings in HSTS from
pre-103cbed928
is now 62MB, or 96%. And in terms of total resident memory is a 7.5%
reduction. The DAFSA/DAWG used by Firefox is 1.1MB so there could be
additional gains available but this seems like the best option based on
maintained libraries available (I could not find a good maintained
library for DAFSAs in Rust).

The main trick is this: the FST map API is currently designed to map
byte sequences to u64 values. Because we only need to determine if a
preloaded domain has the `includeSubdomains` flag set, we encode that
into the lowest bit of the ids in the map. This way finding an entry in
the map directly provides us with the `includeSubdomains` flag and we
don't need to keep another mapping in memory or on disk.

Updated the `./mach update-hsts-preload` command to generate the new FST
map file. (Not sure if I need to update any dev-dependencies anywhere
for this change)

This change also replaces the use of "mozilla.org" with "example.com" in
the HSTS unit tests to make sure that entries in the preload list do not
influence the tests (since example.com should not ever end up on the
preload list)

Testing: Updated unit tests
Fixes: #25929

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-05-20 04:26:55 +00:00
..
allocator Organize component Cargo.toml dependencies (#36224) 2025-03-30 19:03:54 +00:00
background_hang_monitor Organize component Cargo.toml dependencies (#36224) 2025-03-30 19:03:54 +00:00
bluetooth Replace bluetooth Readme with corrected version from devices repository (#36429) 2025-04-10 18:02:45 +00:00
canvas canvas: Move generic implementations into GenericPathBuilder trait (#36999) 2025-05-14 03:51:56 +00:00
compositing compositor: Batch all pending scroll event updates into a single transaction (#36974) 2025-05-16 18:26:59 +00:00
config Remove the dom_shadowdom_enabled preference (#37043) 2025-05-18 17:42:21 +00:00
constellation Fully support <input type=color> (#36992) 2025-05-15 17:30:38 +00:00
deny_public_fields
devtools DevTools: Improve resource_available to handle multiple connections (#36933) 2025-05-09 12:06:33 +00:00
dom_struct
domobject_derive
fonts fonts: Fix calculation of font underline thickness on macOS (#37029) 2025-05-16 18:23:02 +00:00
geometry
hyper_serde
jstraceable_derive
layout layout: Correct damage propagation and style repair for repaint-only layout (#37004) 2025-05-19 10:17:49 +00:00
malloc_size_of layout: Share styles to inline box children via SharedInlineStyles (#36896) 2025-05-12 09:38:50 +00:00
media compositing: Combine webrender_traits and compositing_traits (#36372) 2025-04-06 17:34:18 +00:00
metrics Move ScriptToConstellationMsg to constellation_traits (#36364) 2025-04-05 22:13:29 +00:00
net Replace hsts preload list hashmap with an FST (#37015) 2025-05-20 04:26:55 +00:00
pixels pixels: Actually write pixels in MULTIPLY generic_transform_inplace operations (#36895) 2025-05-08 07:38:02 +00:00
profile Remove layout-2013 profiling categories (#37014) 2025-05-15 16:54:02 +00:00
rand
range
script script: Make Blob.ArrayBuffer() more specification-compliant (#35748) 2025-05-19 11:55:06 +00:00
script_bindings script: Make Blob.ArrayBuffer() more specification-compliant (#35748) 2025-05-19 11:55:06 +00:00
servo Don't build testbinding-related code by default (#37034) 2025-05-17 08:14:19 +00:00
servo_tracing [tracing] Add convenience macro for function tracing (#36573) 2025-04-22 19:58:20 +00:00
shared Replace hsts preload list hashmap with an FST (#37015) 2025-05-20 04:26:55 +00:00
timers
url Various memory measurement improvements (#36834) 2025-05-07 04:00:12 +00:00
webdriver_server Fix WebDriverSession::input_cancel_list related logic (#37010) 2025-05-19 08:34:04 +00:00
webgl webgl: Use glow::Context::supported_extensions() to implement getSupportedExtensions() (#36911) 2025-05-08 08:34:52 +00:00
webgpu Introduce snapshot concept of canvas (#36119) 2025-04-23 07:32:47 +00:00
webxr libservo: Expose a ServoBuilder (#36549) 2025-04-16 16:58:52 +00:00