yonaskolb / yonaskolb/XcodeGen

Reducing compiled asset size

Open
#1,478 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
8.8k
Forks
908
Avg merge
17d 14h
Merged PRs (30d)
2

Description

If I compile main the resulting binary is about 15.9MBs. This appears consistent with the size in this repo's Releases.

For various reasons I need to package xcodegen as a local binary but the total size of what I'm building needs to be below 8MBs. I'm wondering if there are ways to bring downt the size of xcodegen?

I used bloaty to check out the compiled binary, unfortunately the recommended -d compileunits flag won't work (missing debug info) but without that flag I get:

    FILE SIZE        VM SIZE
 --------------  --------------
  39.5%  6.26Mi  40.9%  3.35Mi    __TEXT,__text
  25.6%  4.06Mi  24.9%  2.04Mi    String Table
  22.2%  3.52Mi  21.6%  1.77Mi    Symbol Table
   3.3%   531Ki   3.2%   269Ki    Export Info
   1.4%   231Ki   1.2%   101Ki    [41 Others]
   1.1%   182Ki   1.1%  91.7Ki    __DATA,__data
   0.9%   150Ki   0.9%  72.3Ki    __TEXT,__const
   0.7%   112Ki   0.7%  56.5Ki    __TEXT,__cstring
   0.0%       0   1.3%   106Ki    __DATA,__bss
   0.5%  86.3Ki   0.5%  43.1Ki    __TEXT,__swift5_fieldmd
   0.5%  86.0Ki   0.0%       3    __DATA_CONST,__const
   0.5%  83.5Ki   0.2%  16.3Ki    __TEXT,__eh_frame
   0.5%  78.8Ki   0.5%  39.8Ki    __DATA,__objc_const
   0.5%  78.5Ki   0.4%  35.4Ki    Binding Info
   0.5%  78.0Ki   0.4%  35.0Ki    __TEXT,__unwind_info
   0.4%  71.7Ki   0.4%  35.8Ki    __TEXT,__swift5_reflstr
   0.4%  70.1Ki   0.4%  35.2Ki    Lazy Binding Info
   0.4%  66.1Ki   0.8%  66.1Ki    __DATA,__const
   0.4%  62.1Ki   0.4%  31.1Ki    __TEXT,__constg_swiftt
   0.4%  61.8Ki   0.0%       0    Code Signature
   0.3%  50.6Ki   0.3%  25.3Ki    __TEXT,__swift5_typeref
 100.0%  15.9Mi 100.0%  8.20Mi    TOTAL

Is there anything here that can be stripped out?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the main build and inspecting the compiled binary with bloaty, using the size breakdown in this issue as the baseline. Done means identifying removable or reducible contents and bringing the packaged local xcodegen binary below 8MB.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.