Skip to content

Further improving the footprint #1007

@nabetti1720

Description

@nabetti1720

LLRT already has features that other runtimes do not have, but we believe that we need to further refine them, even if we have to forego some compatibility.

To further improve the small footprint, one of the features of this product, we are considering the following:

  • llrt_fetch: Keep http2 support as a crate, but default LLRT to http1 only (this will prevent the h2 crate from being included)
  • llrt_fetch: By adopting rustls-platform-verifier instead of webkpi-roots, certificates are not stored internally. See also Http module should offer native roots as an alternative to webkpi-roots #768 (comment)
  • llrt_fetch/llrt_zlib: The crate will retain brotli functionality, but will not use it as an LLRT. I think it won't be a problem as long as it supports zstd, which is used for other purposes and is indispensable, and gzip, which is still widely used. https://w3techs.com/technologies/details/ce-compression
  • llrt_os: We'll put all the functions the sysinfo crate needs behind the feature flags and change the default to off.
  • llrt_crypto: Organizing crates required for subtleCrypto (this requires improvements to the crate it uses).

Is there anything else you can think of?

For reference:

% cargo bloat --profile=flame --crates

 File  .text     Size Crate
13.6%  20.8%   1.4MiB rquickjs_core
11.1%  16.9%   1.2MiB [Unknown]
 7.4%  11.2% 795.0KiB std
 3.3%   5.0% 353.6KiB h2
 3.1%   4.8% 339.6KiB llrt_stream_web
 2.4%   3.7% 260.3KiB rustls
 2.0%   3.1% 217.7KiB zstd_sys
 1.7%   2.7% 188.9KiB tokio
 1.4%   2.1% 147.9KiB ring
 1.3%   2.0% 141.0KiB llrt_crypto
 1.2%   1.8% 124.7KiB hyper
 1.1%   1.7% 117.0KiB llrt_core
 1.0%   1.6% 112.9KiB hyper_util
 0.9%   1.4% 100.7KiB rquickjs_sys
 0.9%   1.3%  92.0KiB brotlic_sys
 0.8%   1.2%  83.6KiB llrt
 0.6%   1.0%  67.3KiB num_bigint_dig
 0.6%   0.9%  66.8KiB primeorder
 0.6%   0.9%  63.2KiB llrt_utils
 0.6%   0.9%  61.0KiB http
10.2%  15.6%   1.1MiB And 120 more crates. Use -n N to show more.
65.4% 100.0%   6.9MiB .text section size, the file size is 10.5MiB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions