Two years ago, I started developing a Scheme interpreter in Swift from scratch. I recently migrated the code from Swift 3 to Swift 4 using the migration tool, and eventually switched off @objc inference. I was expecting that at this stage, my compiled binary would perform at least as well as with Swift 3. So, I was surprised to see that even if compiled as a release, my interpreter was significantly slower (factor 2 on trivial microbenchmarks). Yesterday, I coincidentally compiled my binary with the Swift Package Manager. To my surprise, the resulting binary executes much faster on the microbenchmarks I tried (at least as fast as before with Swift 3). The only real difference I can see is that SPM linked everything statically, whereas my Xcode/Carthage based application is linked dynamically. But that alone, can't explain the performance difference.
I was wondering if someone could give me some advice on suitable ways to debug this issue? Did anyone experience something similar after the migration from Swift 3 to Swift 4? I've also checked the automatically migrated project settings, and I can't see anything suspicious either.
Thanks,
Matthias