Skip to content

Commit

Permalink
boulder/moss: Reduce binary size by reducing dependency features
Browse files Browse the repository at this point in the history
I used cargo-bloat to find out what some of the biggest offenders with regards to binary size were and found that reqwest and regex could both be trimmed a bit by disabling some features that we don't need.

For regex I switched it to only have the `std` feature enabled. This disables some of the performance features and unicode support but as far as I can tell we don't use the unicode support and the existing regexes are in non-performance-critical sections. This reduces boulder binary size with the `release` profile from `16.9MiB` -> `15.2MiB`.

For reqwest I switched to using `native-tls` over `rustls`. Since this links against the system openssl the binary size is further reduced from `15.2MiB` -> `13.1MiB`.

Final binary sizes when this patch is applied to the experimental Solus package (which already links against system libzstd and sqlite3) are:
- Boulder: 11.8MiB -> 9.2MiB (-22%)
- Moss: 10.7MiB -> 8.1MiB (-24%)
  • Loading branch information
ReillyBrogan committed Aug 16, 2024
1 parent 4966f0f commit 6da5344
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 120 deletions.
Loading

0 comments on commit 6da5344

Please sign in to comment.