[swift-evolution] Yet another fixed-size array spitball session
david at alkaline-solutions.com
Wed May 31 12:15:28 CDT 2017
> On May 31, 2017, at 9:28 AM, Robert Bennett via swift-evolution <swift-evolution at swift.org> wrote:
> Without static arrays, swift cannot be used in high performance applications. The cost of repeated heap accesses is simply too high. And tuples are not ergonomic enough to use in the same manner as arrays. So I think we do need to add static arrays to Swift, if not necessarily in Swift 4.
I don’t quite understand why there is such a massive heap access cost vs stack. My understanding is the instructions for both are pointer dereferences, both stack and heap memory equally cache, neither require read or write barriers with swift, and the MMU isn’t set to fault heap memory (except as a general virtual memory policy).
More information about the swift-evolution