<div dir="ltr">Hi all, <br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><p>In my continued investigation of Swift compile times I was able to gather some interesting data. </p><p>In the last couple weeks we decided to put in a large dev effort to move our entire codebase into frameworks. We'd been having really slow build times (often 5 minutes for an incremental compile, 12 minutes for a clean build) and decided it was worth the effort to clean it up. </p><p>I had expected that moving code into frameworks would substantially speed up the incremental compile time, but didn't expect it to speed up the clean compile. To my surprise, it sped up the incremental compile to less than a minute in most cases and just a little over 2 minutes for a clean build. </p><p>Investigating further, I added the -debug-time-function-bodies flag and parsed out the build times for individual functions- following the instructions from: <a href="http://irace.me/swift-profiling" target="_blank">http://irace.me/swift-profiling</a> Looking at our code pre- and post- frameworks move (and pre-frameworks actually had about 10% of the code in frameworks) I got the following results: </p><p>*Pre-frameworks:*</p><p>9842 functions compiled. </p><p>1463 unique functions compiled </p><p>8379 of the functions compiled were duplicates</p><p>*Post-frameworks:*</p>
<p>2805 functions compiled.</p>
<p>1288 unique functions compiled
</p><p>1517 of the functions compiled were duplicates</p><div>So first, just want to say, that the frameworks solution really worked. It has resulted in a huge increase in productivity, and I like our codebase better. It's made me love Swift again. </div><div><br></div><div>I'm wondering though: is this a known/expected result? I was pretty surprised by the amount of duplicated compiles but I'm not experienced in this area so maybe that's normal. Would love any clarification on how this works. </div><div><br></div><div>Thanks so much! <br>Sam</div></div></div></div>
</div>