Tip Of The Week: Swift Local Computed Variables by objc.io

The guys over at objc.io are posting Weekly Swift Tips on a clockwork schedule – this week they explain how ‘local computed properties‘ can be used to speed-up code where variables that can be expensive to compute are not used in all branches. This seems like one of the first things any optimising compiler should take care of (doing calculations only when they are actually needed), does anyone have any hard data on whether the Swift compiler really does not figure this out on its own? How about other languages and compilers?

1 Comment on " Tip Of The Week: Swift Local Computed Variables by objc.io"

  1. This is informative post for me.
    I added your web into my favourites!
    P.S.: Looking forward for new updates.

    Best regards,
    Travis

Leave a comment

Your email address will not be published.


*