Skip to content

⚡️ reduce binary size#98

Merged
jfbus merged 1 commit intomainfrom
binary_size
Mar 5, 2026
Merged

⚡️ reduce binary size#98
jfbus merged 1 commit intomainfrom
binary_size

Conversation

@jfbus
Copy link
Copy Markdown
Contributor

@jfbus jfbus commented Mar 5, 2026

Description

This PR reduces the binary size by ~10%:

  • embeds all config in a zip archive (~400KB saved)
  • drops emoji support in markdown output (~600KB saved)
  • replaces github client with direct http call (~900KB saved)
  • drop github.com/goccy/go-json (~900KB saved)
┌────────────────────────────────────────────────────────────────────────────────────┐
│ Diff between octlnozip and octl                                                    │
├─────────┬──────────────────────────────────────────┬──────────┬──────────┬─────────┤
│ PERCENT │ NAME                                     │ OLD SIZE │ NEW SIZE │ DIFF    │
├─────────┼──────────────────────────────────────────┼──────────┼──────────┼─────────┤
│ +100%   │ archive/zip                              │          │ 51 kB    │ +51 kB  │
│ +7.99%  │ slices                                   │ 193 kB   │ 208 kB   │ +15 kB  │
│ +1.13%  │ github.com/outscale/octl                 │ 254 kB   │ 256 kB   │ +2.9 kB │
│ +2.07%  │ compress/flate                           │ 61 kB    │ 62 kB    │ +1.3 kB │
│ +0.10%  │ github.com/itchyny/gojq                  │ 705 kB   │ 706 kB   │ +730 B  │
│ +14.34% │ internal/filepathlite                    │ 4.2 kB   │ 4.8 kB   │ +607 B  │
│ +1.23%  │ io                                       │ 40 kB    │ 40 kB    │ +485 B  │
│ +0.01%  │ github.com/outscale/osc-sdk-go/v3        │ 3.0 MB   │ 3.0 MB   │ +257 B  │
│ +0.01%  │ github.com/yuin/goldmark                 │ 1.6 MB   │ 1.6 MB   │ +119 B  │
│ +0.04%  │ os                                       │ 167 kB   │ 167 kB   │ +67 B   │
│ +0.08%  │ bufio                                    │ 22 kB    │ 22 kB    │ +17 B   │
│ +0.01%  │ github.com/aws/smithy-go                 │ 270 kB   │ 270 kB   │ +17 B   │
│ +0.00%  │ github.com/alecthomas/chroma/v2          │ 700 kB   │ 700 kB   │ +17 B   │
│ +0.01%  │ github.com/microcosm-cc/bluemonday       │ 255 kB   │ 256 kB   │ +16 B   │
│ +0.11%  │ github.com/muesli/reflow                 │ 11 kB    │ 11 kB    │ +12 B   │
│ +0.02%  │ sync                                     │ 60 kB    │ 60 kB    │ +11 B   │
│ +0.03%  │ vendor/golang.org/x/net/http2/hpack      │ 32 kB    │ 32 kB    │ +10 B   │
│ +0.48%  │ vendor/golang.org/x/text/secure/bidirule │ 2.1 kB   │ 2.1 kB   │ +10 B   │
│ +0.01%  │ encoding/asn1                            │ 67 kB    │ 67 kB    │ +5 B    │
│ +0.01%  │ github.com/charmbracelet/x/ansi          │ 64 kB    │ 64 kB    │ +4 B    │
│ +0.00%  │ github.com/gabriel-vasile/mimetype       │ 185 kB   │ 185 kB   │ +4 B    │
│ +0.03%  │ unique                                   │ 15 kB    │ 15 kB    │ +4 B    │
│ +0.00%  │ github.com/charmbracelet/bubbletea       │ 103 kB   │ 103 kB   │ +3 B    │
│ +0.02%  │ vendor/golang.org/x/net/http/httpproxy   │ 12 kB    │ 12 kB    │ +2 B    │
│ +0.00%  │ vendor/golang.org/x/text/unicode/norm    │ 45 kB    │ 45 kB    │ +2 B    │
│ +0.00%  │ github.com/charmbracelet/huh             │ 231 kB   │ 231 kB   │ +2 B    │
│ +0.00%  │ github.com/oasdiff/yaml3                 │ 299 kB   │ 299 kB   │ +1 B    │
│ +0.00%  │ gopkg.in/yaml.v3                         │ 293 kB   │ 293 kB   │ +1 B    │
│ +0.00%  │ github.com/benbjohnson/clock             │ 26 kB    │ 26 kB    │ +1 B    │
│ -0.01%  │ encoding/csv                             │ 12 kB    │ 12 kB    │ -1 B    │
│ -0.00%  │ github.com/spf13/pflag                   │ 277 kB   │ 277 kB   │ -1 B    │
│ -0.01%  │ github.com/getkin/kin-openapi            │ 9.6 kB   │ 9.6 kB   │ -1 B    │
│ -0.00%  │ github.com/expr-lang/expr                │ 716 kB   │ 716 kB   │ -2 B    │
│ -0.00%  │ github.com/muesli/termenv                │ 112 kB   │ 112 kB   │ -2 B    │
│ -0.01%  │ hash                                     │ 25 kB    │ 25 kB    │ -2 B    │
│ -0.01%  │ bytes                                    │ 39 kB    │ 39 kB    │ -3 B    │
│ -0.01%  │ vendor/golang.org/x/crypto/cryptobyte    │ 26 kB    │ 26 kB    │ -3 B    │
│ -0.01%  │ context                                  │ 42 kB    │ 42 kB    │ -3 B    │
│ -0.00%  │ log                                      │ 123 kB   │ 123 kB   │ -4 B    │
│ -0.00%  │ github.com/dlclark/regexp2               │ 229 kB   │ 229 kB   │ -4 B    │
│ -0.01%  │ strings                                  │ 57 kB    │ 57 kB    │ -5 B    │
│ -0.00%  │ github.com/charmbracelet/glamour         │ 162 kB   │ 162 kB   │ -6 B    │
│ -0.00%  │ net                                      │ 1.2 MB   │ 1.2 MB   │ -9 B    │
│ -0.01%  │ encoding/xml                             │ 116 kB   │ 115 kB   │ -12 B   │
│ -0.01%  │ github.com/charmbracelet/bubbles         │ 147 kB   │ 147 kB   │ -12 B   │
│ -0.00%  │ text/template                            │ 251 kB   │ 251 kB   │ -12 B   │
│ -0.19%  │ embed                                    │ 11 kB    │ 11 kB    │ -20 B   │
│ -0.00%  │ crypto                                   │ 1.7 MB   │ 1.7 MB   │ -33 B   │
│ -0.02%  │ github.com/spf13/cobra                   │ 229 kB   │ 229 kB   │ -36 B   │
│ -0.01%  │ github.com/goccy/go-yaml                 │ 661 kB   │ 661 kB   │ -43 B   │
│ -0.00%  │ github.com/aws/aws-sdk-go-v2             │ 6.8 MB   │ 6.8 MB   │ -54 B   │
│ -0.11%  │ mime                                     │ 54 kB    │ 54 kB    │ -59 B   │
│ -0.08%  │ math                                     │ 237 kB   │ 237 kB   │ -199 B  │
│ -100%   │ github.com/google/go-querystring         │ 489 B    │          │ -489 B  │
│ -0.06%  │ runtime                                  │ 937 kB   │ 936 kB   │ -533 B  │
│ -0.38%  │ reflect                                  │ 321 kB   │ 320 kB   │ -1.2 kB │
│ -4.74%  │ <autogenerated>                          │ 476 kB   │ 453 kB   │ -23 kB  │
│ -99.88% │ github.com/yuin/goldmark-emoji           │ 390 kB   │ 455 B    │ -389 kB │
│ -100%   │ github.com/google/go-github/v82          │ 582 kB   │          │ -582 kB │
│ -100%   │ github.com/goccy/go-json                 │ 757 kB   │          │ -757 kB │
├─────────┼──────────────────────────────────────────┼──────────┼──────────┼─────────┤
│ +11.10% │ .noptrdata                               │ 634 kB   │ 704 kB   │ +70 kB  │
│ -2.47%  │ .go.buildinfo                            │ 9.7 kB   │ 9.5 kB   │ -240 B  │
│ -2.30%  │ .itablink                                │ 14 kB    │ 13 kB    │ -312 B  │
│ -7.20%  │ .typelink                                │ 45 kB    │ 42 kB    │ -3.2 kB │
│ -2.71%  │ .data                                    │ 285 kB   │ 278 kB   │ -7.7 kB │
│ -26.31% │ .gopclntab                               │ 378 kB   │ 279 kB   │ -100 kB │
│ -15.54% │ .rodata                                  │ 6.9 MB   │ 5.8 MB   │ -1.1 MB │
├─────────┼──────────────────────────────────────────┼──────────┼──────────┼─────────┤
│ -7.73%  │ octlnozip                                │ 36 MB    │ 33 MB    │ -2.8 MB │
│         │ octl                                     │          │          │         │
└─────────┴──────────────────────────────────────────┴──────────┴──────────┴─────────┘

Type of Change

Please check the relevant option(s):

  • 🐛 Bug fix
  • ✨ New feature
  • 🧹 Code cleanup or refactor
  • 📝 Documentation update
  • 🔧 Build or CI-related change
  • 🔒 Security fix
  • Other (specify):

How Has This Been Tested?

Please describe the test strategy:

  • Manual testing
  • Unit tests
  • Integration tests
  • Not tested yet

Checklist

  • I have followed the Contributing Guidelines
  • I have added tests or explained why they are not needed
  • I have updated relevant documentation (README, examples, etc.)
  • My changes follow the Conventional Commits specification
  • My commits include appropriate Gitmoji

Additional Context

@jfbus jfbus marked this pull request as ready for review March 5, 2026 12:10
ryohkhn
ryohkhn previously approved these changes Mar 5, 2026
@jfbus jfbus merged commit ae8ad0e into main Mar 5, 2026
4 checks passed
@jfbus jfbus deleted the binary_size branch March 5, 2026 14:19
@jfbus jfbus added the kind/cleanup Removal or cleanup label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Removal or cleanup

Development

Successfully merging this pull request may close these issues.

3 participants