Apollo-ios: Expressions taking too long to type-check

Created on 23 Sep 2017  路  1Comment  路  Source: apollographql/apollo-ios

Having updated to Xcode 9 we now have the ability to receive warnings when certain expressions are taking too long to type-check (subsequently having an impact on compile times)

-Xfrontend -warn-long-expression-type-checking=200

Within the GitHawk project we have a few generated warnings around the "definitions" generated by Apollo - These are basically just a load of strings concatenated together across multiple lines (presumably for readability)

Obviously depending on the GraphQL definitions these can get pretty big or remain relatively small but regardless I feel improvements could be made.

One improvement as part of Swift 4 could be to use multiline strings, removing the need for excessive concatenation

image

Most helpful comment

Nice catch! That 13883ms seems like it would have a pretty significant impact!

I removed string concatenation from the definitions in Apollo iOS 0.7.0-alpha.5. I'd like to switch to Swift 4 multiline strings, but there are some issues with compiling CocoaPods with Swift 4.

>All comments

Nice catch! That 13883ms seems like it would have a pretty significant impact!

I removed string concatenation from the definitions in Apollo iOS 0.7.0-alpha.5. I'd like to switch to Swift 4 multiline strings, but there are some issues with compiling CocoaPods with Swift 4.

Was this page helpful?
0 / 5 - 0 ratings