Skip to content

bench: time cold installs on a 10 Mbit link - #1901

Merged
zackees merged 2 commits into
mainfrom
feat/bench-10mbit
Nov 5, 2026
Merged

zackees merged 2 commits into
mainfrom
feat/bench-10mbit

Conversation

@zackees

@zackees zackees commented Nov 5, 2026

Copy link
Copy Markdown
Member

Why

The published cold numbers showed fbuild only ~1.66x faster than PlatformIO, not because fbuild is slow but because the measurement excluded the win by construction:

  • the workflow ran a Prime package downloads outside timed measurements step, and
  • cold cleanup explicitly retained installed packages/toolchains and fbuild package archives.

The ESP32 framework reduction (2.5 GB whole bundle -> ~40 MB per-chip slice) therefore never landed inside the timed window. Network transfer is part of a real cold install, so it must be measured.

What changed

  • bench-build-comparison
    • New --network-mbit <u32> option (default 0 = unthrottled), threaded through Options and Metadata.
    • network_mbit is emitted in latest.json metadata.
    • ESP32-S3 cold cleanup now also removes the cached framework packages, so the core + libs download happens inside the timed build:
      • fbuild: <cache>/platforms/framework-arduinoespressif32* (verified layout: ~/.fbuild/<mode>/cache/platforms/<stem>/<hash>/<version>/; the libs archive is cached inside that tree at tools/.libs-archives).
      • PlatformIO: ~/.platformio/packages/framework-arduinoespressif32* and ~/.platformio/cache*.
      • Toolchains (cache/toolchains/, ~/.platformio/packages/toolchain-*) are deliberately untouched; a ~175 MB toolchain download on 10 Mbit would risk the 60-minute job timeout.
      • Arduino CLI and Uno behavior are unchanged.
    • Site note now explains that cold re-downloads framework/lib packages, and adds when shaped: * Measured on a link limited to 10 Mbit/s (tc traffic shaping); cold includes framework/lib download time.
  • Workflow
    • Removed the prime-downloads step. Replaced it with a toolchain-only fbuild install warmup; the harness deletes framework packages before every timed build, so their download is still timed.
    • Shapes the default-route interface with tc qdisc replace ... tbf rate 10mbit burst 64kbit latency 50ms, verifies the qdisc readback, and fails the job (never publishes) if shaping fails.
    • Always tears the qdisc down with an if: always() cleanup step.
    • Passes --network-mbit 10.
  • Tests: new coverage for the option/metadata, the disclosure HTML, ESP32-only package removals, and prefix-scoped cache deletion that leaves toolchains alone.

Caveat

Cold now includes framework/lib downloads; toolchains remain warm by design. Uno cold behavior is unchanged. The first ESP32 trial also installs anything missing from a totally clean cache, but medians are over 3 trials.

Verification (local, unshaped)

  • soldr cargo test -p fbuild-bench-fastled-examples -> 38 passed, 0 failed
  • soldr cargo build --release -p fbuild-bench-fastled-examples --bin bench-build-comparison -> Finished
  • soldr cargo fmt --all -- --check -> clean
  • No full benchmark run and no tc shaping applied locally.

Cold used to be measured with package downloads primed outside the timed
window and with framework packages retained, so the 2.5 GB -> ~40 MB ESP32
framework reduction never appeared in the numbers.

- Add --network-mbit (default 0) and emit network_mbit in latest.json.
- ESP32-S3 cold cleanup now deletes the fbuild framework platform packages
  (~/.fbuild/<mode>/cache/platforms/framework-arduinoespressif32*) and
  PlatformIO's framework-arduinoespressif32* + cache* entries. Toolchains are
  deliberately kept so the run fits the 60-minute CI timeout.
- Replace the prime-downloads step with a toolchain-only fbuild install warmup;
  the benchmark deletes framework packages before every timed build.
- Shape the runner NIC to 10 Mbit/s with tc tbf, fail loudly if shaping or
  readback fails, and always remove the qdisc.
- Disclose the 10 Mbit/s condition and the cold download definition on the
  published site.
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

tc qdisc root tbf shapes egress only. Downloads are ingress, so the previous
setup would have left every framework/lib fetch at full link speed while the
report said 10 Mbit/s, and the qdisc readback check would have passed anyway.

Redirect ingress into an ifb device and shape that (fallback: ingress
policing), then prove it bites by pulling 10 MB and failing the job if the
achieved rate exceeds ~10 Mbit/s. Tear down the ingress qdisc and ifb in the
cleanup step.
@zackees
zackees merged commit 1a60f98 into main Nov 5, 2026
28 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 5, 2026
@zackees
zackees deleted the feat/bench-10mbit branch November 5, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant