awslabs / awslabs/llrt

Further improving the footprint

Open
#1,007 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
8.8k
Forks
393
Avg merge
1d 11h
Merged PRs (30d)
45

Description

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 https://github.com/awslabs/llrt/issues/768#issuecomment-2930897137
- 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
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the cargo bloat --profile=flame --crates output and the referenced llrt_fetch, llrt_zlib, llrt_os, and llrt_crypto crates. Determine which footprint changes are agreed and measure their effect against the current baseline; done requires an accepted scope and verified size reduction without losing the required runtime functionality.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.