Closed RamblinWreck77 closed 4 years ago
Class funcs use dynamic dispatch by default, while static funcs do not.
https://borgs.cybrilla.com/tils/global-vs-static-function-swift/
Static dispatch is faster than dynamic dispatch, as the compiler has the chance to inline stuff + other neat tricks.
https://medium.com/flawless-app-stories/static-vs-dynamic-dispatch-in-swift-a-decisive-choice-cece1e872d
So unless there is an explicit need for dynamic dispatch static func is preferable to class func. I don't see a benchmark tool but I imagine this is faster across the board.
The failure above is due to a test that tries to override one of the newly static functions. Is this test method absolutely required?
Closing this since it was merged in a different PR
Class funcs use dynamic dispatch by default, while static funcs do not.
https://borgs.cybrilla.com/tils/global-vs-static-function-swift/
Static dispatch is faster than dynamic dispatch, as the compiler has the chance to inline stuff + other neat tricks.
https://medium.com/flawless-app-stories/static-vs-dynamic-dispatch-in-swift-a-decisive-choice-cece1e872d
So unless there is an explicit need for dynamic dispatch static func is preferable to class func. I don't see a benchmark tool but I imagine this is faster across the board.