Swift gets a bit swifter: version 1.2 first impressions

Xcode 6.3 appeared in my update tray this morning, and since it contains Swift 1.2, I installed it right away. The first thing I noticed, after fixing about 200 compiler errors due to minor changes in language syntax, was that the work-in-progress XMDS app all of a sudden got really snappy. Rather than feeling like using a computer that’s 10 years obsolete, algorithms that were borderline rate limiting running in the main UI thread just happen like they ought to. As a reality check, I re-ran the horrendously underperforming algorithm that I complained about awhile back, and rather than taking 320 seconds to calculate 7 log P values, it now gets the job done in 30 seconds. That comparison is with standard compiler options. The alternate target with all the optimisation settings dialled up actually crashes the Swift compiler, so no metrics for that.

Nonetheless, 10x improvement in a scenario that’s relevant to cheminformatics, and a qualitative observation that this seems to be representative for GUI tasks, is a big deal. I’m sure there’s a lot more fat to trim over the coming years, since the Swift syntax is designed in a way that allows the compiler to do some pretty hardcore optimisation. Getting the practical implementation levelled up to “adequate” is a good start!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s