<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On 17 Feb 2017, at 21:58, Michel Loenngren via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">All,<div class=""><br class=""></div><div class="">When starting an app that includes swift these libs are being loaded:</div><div class=""><span style="color:rgb(51,51,51);font-family:&quot;helvetica neue&quot;;font-size:14px" class=""><br class=""></span></div><div class=""><span style="color:rgb(51,51,51);font-family:&quot;helvetica neue&quot;;font-size:14px" class=""><i class="">libswiftCoreGraphics.dylib&nbsp;</i></span></div><div class=""><span style="color:rgb(51,51,51);font-family:&quot;helvetica neue&quot;;font-size:14px" class=""><i class="">libswiftDispatch.dylib    &nbsp;</i></span></div><div class=""><span style="color:rgb(51,51,51);font-family:&quot;helvetica neue&quot;;font-size:14px" class=""><i class="">libswiftObjectiveC.dylib</i></span></div><div class=""><i class="">libswiftCore.dylib</i></div><div class=""><i class="">libswiftDarwin.dylib</i></div><div class=""><i class="">libswiftFoundation.dylib</i></div><div class=""><i class=""><br class=""></i></div><div class="">which adds considerable delay to our app startup time (compared to running a pure objective-c codebase). Is anybody aware of a way to reduce startup by combining these libs into a single lib for faster load time?</div></div></div></blockquote><br class=""></div><div>At the moment, these are provided as individual libraries because they are built as separate libraries on the command line. It's possible to build a static version of the core library with swiftc -static-stdlib on Darwin (there are still work in progress items for Linux and Foundation).</div><div><br class=""></div><div><a href="https://bugs.swift.org/browse/SR-730" class="">https://bugs.swift.org/browse/SR-730</a></div><div><br class=""></div><div>However, note that the majority of the libraries that you list are also used in a pure objective-c codebase; for example, running otool -L on Mail.app gives:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>/usr/lib/libobjc.A.dylib</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>/usr/lib/libSystem.B.dylib</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(Dispatch is embedded in libSystem on Darwin)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">So the libraries you load are the same ones (in effect) to the ones used by your Objective-C application, in all likelihood. The difference is probably in the way that the libraries are set up and the dispatch once code is executed - which are necessary steps in bringing the Swift runtime up for your application.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Alex</span></div></span></div></div><br class=""></body></html>