Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wow, that is crazy. For me (Swift 5.10) that single line is taking 11 seconds. Meanwhile, I have a 16,000 line app (importing AppKit, SceneKit and more) that compiles in 8 seconds.


Following up with compile time of a few variations.

    let result:Double = -(1 + 1) + -(1 + 1) - 1 // 10.829s
    let result:Double = -(1 + 1) + -(1 + 1)     // 1.724s
    let result:Double =  (1 + 1) +  (1 + 1) - 1 // 1.721s
    let result:Double = -(1 + 1)            - 1 // 0.763s
    let result:Int    = -(1 + 1) + -(1 + 1) - 1 // 0.571s

    let result:Double = -(1 + 1) + -(1 + 1) + 1
    //error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: