Use temporary variables to break the slow expressions into multiple statements. In addition, it might be worth adding -Xfrontend and -warn-long-expression-type-checking=100 to your project’s “Other swift flags” build setting to be warned when an expression takes longer than 100 milliseconds to compile.