Merged
Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Cli
Other
Bug Fixes 🐛Upgrade
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 3947 uncovered lines. Files with missing lines (64)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 67.47% 67.47% —%
==========================================
Files 99 99 —
Lines 12133 12133 —
Branches 0 0 —
==========================================
+ Hits 8186 8186 —
- Misses 3947 3947 —
- Partials 0 0 —Generated by Codecov Action |
Add `minify: true` to the Bun.build() call in script/build.ts. Benchmarked all optimization flags (minify, bytecode, sourcemap, --smol) with hyperfine (50 runs, 5 warmup). minify alone was the clear winner: -1% binary size, -6% startup time, -4% peak memory, zero trade-offs. bytecode increased binary size +10% for negligible startup gain. --smol had zero measurable effect for a short-lived CLI process. sourcemap: linked is viable (+2 MB) but deferred for now.
8c7abfd to
f85e080
Compare
This was referenced Feb 10, 2026
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.
Summary
Add
minify: truetoBun.build()for standalone executables inscript/build.ts.Benchmarked all Bun compile optimization flags (
minify,bytecode,sourcemap: "linked",execArgv: ["--smol"]) using hyperfine (50 runs, 5 warmup) on linux-x64:Not shown:
bytecode: truevariants added +10% binary size for negligible startup improvement.Decisions
minify: true— applied. Smaller binary, faster startup, less memory. No trade-off.bytecode: true— rejected. +10 MB binary size, bytecode representation larger than minified source.--smol— rejected. Zero measurable effect for a CLI that exits in <1s.sourcemap: "linked"— deferred. +2 MB for readable stack traces, viable for the future.Full plan and benchmark details in
script/OPTIMIZE-BINARIES.md(also attached as a git note).