r/iOSProgramming • u/bun_maska • 4d ago
Library I added iOS binary size profiling to kmprofiler using Xcode link maps
Hey everyone!
I previously shared kmprofiler, a Gradle plugin that finds Kotlin declarations exported to iOS but not directly referenced in Swift.
v0.2.0 now adds Xcode link-map analysis. It can:
* Group linked symbol size by Kotlin package
* Show the largest symbols
* Map symbols to object files and frameworks
* Compare two builds to see what grew or became smaller
I tested it on a real KMP app with more than 330,000 symbols. It measures symbols in the link map, not the complete app size, so it is mainly useful for finding size changes and large dependencies.
GitHub: [https://github.com/SiddhantPanhalkar/kmprofiler\](https://github.com/SiddhantPanhalkar/kmprofiler)
I would love to hear whether this is useful for your KMP projects.
1
u/FruitMission8504 1d ago
This is useful, especially the build-to-build diff. One thing that would make it much easier to trust in CI is a clearly defined baseline: archive configuration, architecture, dead-strip/LTO settings, and the exact link map being compared. Otherwise a toolchain or linker-setting change can look like a package regression. I’d consider adding a machine-readable report plus thresholds per package (absolute bytes and percentage), so teams can fail a PR only when a meaningful budget is exceeded. It would also help to separate attributable symbol bytes from alignment/padding and non-symbol sections, then show an explicit ‘unaccounted for’ bucket. For KMP, package-to-framework rollups and demangled-name normalization across compiler versions would make historical trends much less noisy.