Compile Time Incredibly Slow

后端 未结 8 1171
执笔经年
执笔经年 2020-12-22 23:57

My project consists of ~350 Swift files and ~40 cocoa pod dependencies.

As soon as the entire project was migrated to Swift 3, build times have been <

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-23 00:34

    Concatenating several Strings also can cause increasing compiling times, for example in my case, my compilation times where very high because of this line:

    let fecha = post.dia + " " + post.num_dia + " " + post.mes + " - " + post.hora
    

    When i changed the code to this, it satart compiling in seconds:

    var fecha = post.dia!
    fecha = fecha + " "
    fecha = fecha + post.num_dia!
    fecha = fecha + " "
    fecha = fecha + post.mes!
    fecha = fecha + " - "
    fecha = fecha + post.hora!
    

提交回复
热议问题