Repository navigation
Release binary: size weighed against speed, the fast profile kept - #1450
Merged
Merged
Conversation
Each opt-level was measured against the core's benchmarks and the text crate's timings; every smaller one slowed the queries. The figures, the rejected options and where the size goes are in architecture.md. CI refuses puffin and puffin_http in the default build, as egui_inspection. Closes #1436 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9wKqFskQrYXJ3B9dcPcRQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1436. The outcome is a measurement, not a smaller binary: every way to shrink it that was tried slowed the application, and speed comes first (as the maintainer asked). The release profile stays
opt-level = 3, fat LTO, one codegen unit, stripped.Baseline (Linux, stripped release build): 78.6 MB; 787 crates in the graph of
app. Packages, frompackages.yml: AppImage 40.7 MB,.deb33.5 MB,.rpm25.9 MB.Each option, measured on the same machine (
cargo bench -p engine, 8000 notes of ~13 kB; the text crate's Prettier and highlighting timings):opt-levelquery_notess+ C code and KDF at 3szs,z, 2: rejected. −20 % of binary costs +37 % on every query and +74 % on the cookie jar; 2 buys −3 % for +7 % to +34 % on the same paths.opt-levelunders: rejected. It reaches the C built bycc(QuickJS, onig, SQLite — Prettier and highlighting came back to their speed) but not Rust under fat LTO: Argon2 and BLAKE2 left at 3 were still 35 % slower.panic = "abort": rejected (~5 MB of unwinding tables): D18 catches a panic on the queues.libsqlite3-sysis there forbundled). Default features are already off where it matters (eframe,egui,image,tokio,reqwest,rustls,zip,syntect,merman,resvg,rfd…). Where the size is: Mermaid and what it draws with ~11 MB, the interface 5.6 MB, D-Bus (tray, notifications, screen reader) 3.2 MB,wgpu/naga~3 MB, embedded assets ~6 MB. Removing a Mermaid feature (math: 0.8 MB) or the GLES backend (~0.35 MB) would lose a diagram or a GPU for under 1 MB each: not done.reqwest0.12 (the updater client),usvg/fontdb(merman),dirs5 and 6 (the updater,auto-launch: bumping ours to 7 removes none),calloop/smithay-client-toolkit(winit against the clipboard), build-time crates.What changes
lint-rustnow refusespuffinandpuffin_httpin the default build ofapp, as it already refusedegui_inspection(checked locally: absent without the feature,egui_inspectionpresent with--features e2e).docs/architecture.md, « The release binary » under Releasing: the table, each rejected option with its figure, where the size is, the duplicates that stay. A comment on[profile.release]points to it.Tests
cargo bench -p engine --bench commands(--sample-size 10) at each level,crates/text's budget test and a Prettier timing at each level.npx prettier --check; the CI step runs on this pull request.Generated by Claude Code