servo/resources
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
..
ahem
resource_protocol Basic tab strip for the minibrowser (#33100) 2024-08-27 20:17:33 +00:00
user-agent-js dom: Hide debugging extension methods behind a pref. 2020-07-14 22:39:59 -04:00
about-memory.html Make the memory reporting multi-process aware (#35863) 2025-04-05 05:42:12 +00:00
ahem.css
android_params
badcert.html Switch to rustls and webpki-roots (#30025) 2023-08-08 14:00:10 +00:00
badcert.jpg
cert-google-only
cert-wpt-only
crash.html constellation: crash to a new “sad tab” error page (#30290) 2023-09-06 09:52:37 +00:00
Credits.rtf.mako
directory-listing.html Fix missing space in title of directory listings (#35837) 2025-03-07 12:52:09 +00:00
gatt_blocklist.txt
hsts_preload.fstmap Replace hsts preload list hashmap with an FST (#37015) 2025-05-20 04:26:55 +00:00
iso-8859-8.css Treat the keygen element as obsolete (#30429) 2023-09-26 21:37:46 +00:00
neterror.html
not-found.html
package-prefs.json Remove UWP / Hololens support 2023-07-05 09:12:09 +02:00
privatekey_for_testing.key
public_domains.txt Update public_domains.txt 2020-02-12 01:40:06 +01:00
rippy.png
self_signed_certificate_for_testing.crt
servo.icns Update servo.icns icon 2020-11-17 19:36:54 -08:00
servo.ico Update Servo logo files 2020-06-29 23:20:54 -07:00
servo.svg New Servo logo(s) 2020-02-12 16:30:00 -05:00
servo_64.png Update Servo logo files 2020-06-29 23:20:54 -07:00
servo_1024.png Update Servo logo files 2020-06-29 23:20:54 -07:00
tumbeast.png
wpt-prefs.json Implement TestUtils (#36301) 2025-04-04 19:42:28 +00:00