On 7 Sep 2016, at 15:11, louislepegue via swift-users <swift-users@swift.org> 
wrote:
> 
> let simpleTest = Float(abs(11 - -3) + abs(4.5 - -4))  //!
> print ("simpleTest:  \(Simpletest)")
> 

Aside from the fact that the case-sensitivity of simpleTest is important, the 
delay is in the compilation of this script rather than the runtime performance 
of the script. You can compile it with swiftc (which takes around 20s) but then 
when running it the performance is fine.

It's certainly an interesting compiler issue, probably to do with the type 
analysis rather than the complexity of the abs function or the Float cast 
directly. It's still worth raising a bug at https://bugs.swift.org 
<https://bugs.swift.org/> with the snippet though.

Alex
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to