swift icon indicating copy to clipboard operation
swift copied to clipboard

Code size optimizations

Open kateinoigakukun opened this issue 10 months ago • 1 comments

Motivation

Code size is a critical part of reducing initial (un-cached) startup time as it affects download size and compilation time inside Wasm engine.

Sub-tasks

  • [ ] https://github.com/swiftwasm/swift/issues/5601
  • [ ] Explore if we can use archive link instead of object link in SwiftPM
  • [x] Provide a way to strip a part of ICU data embedded through http://github.com/swiftlang/swift-foundation-icu
    • See https://github.com/GoodNotes/swift-icudata-slim

kateinoigakukun avatar Feb 07 '25 07:02 kateinoigakukun

Hi @kateinoigakukun and thanks for the great work!

I'd like to provide some additional data points, from this brief exploration:

  • an hello world program currently compiles to a ~6.8M wasm file
  • using wasm-opt on the resulting binary strip it down to half the size 3.3-3.4Mb

andreaTP avatar Jul 07 '25 11:07 andreaTP