Monday, December 5, 2016 [Tweets] [Favorites]

Guarding Against Long Swift Compiles

Soroush Khanlou:

In May, Jordan Rose added a Swift flag for emitting warnings whenever a function takes longer than some threshold to compile. You can leave this flag enabled in your project, and it will warn you whenever any slow functions are added to the project.

[…]

Add two flags: -Xfrontend and -warn-long-function-bodies=100, where 100 is the number of milliseconds you’d like the warning threshold to be

Previously: Exponential Time Complexity in the Swift Type Checker.

Update (2016-12-06): Simone Manganelli:

Haven’t seen anyone warn about this, but merely enabling these debugging flags can cause compile time to drastically increase.

1 Comment

[…] Previously: Guarding Against Long Swift Compiles. […]

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment