Skip to content

Conversation

@jfernandez
Copy link
Owner

Reduce release binary in Linux by 2.3MB (52% reduction), from 4.4MB to 2.1MB. Optimizations enabled:

  • Enabled LTO
  • Strip symbols in release builds
  • Set codegen-units to 1
  • Use panic = "abort"
  • Removed unused tokio features

This is in prep to include the mermaid.js in the binary to avoid the network call. With these reductions, adding the 2MB library should be a wash, and we get some nice runtime optimizations.

Reduce release binary in Linux by 2.3MB (52% reduction), from 4.4MB to
2.1MB. Optimizations enabled:

- Enabled LTO
- Strip symbols in release builds
- Set codegen-units to 1
- Use panic = "abort"
- Removed unused tokio features

This is in prep to include the mermaid.js in the binary to avoid the
network call. With these reductions, adding the 2MB library should be
a wash, and we get some nice runtime optimizations.
@jfernandez jfernandez requested a review from Copilot September 28, 2025 19:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the release binary build configuration to significantly reduce the binary size from 4.4MB to 2.1MB (52% reduction). The changes prepare the codebase for including mermaid.js in the binary while maintaining a reasonable size footprint.

Key changes:

  • Replaced tokio "full" feature with specific required features
  • Added release profile optimizations including LTO, symbol stripping, and panic abort mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jfernandez jfernandez merged commit 538ab8e into main Sep 28, 2025
5 checks passed
@jfernandez jfernandez deleted the build-optimizations branch September 28, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants