2 ms·
This PR puts the Swift array on terms I think: https://github.com/owensd/handmade-swift/pull/1 https://github.com/owensd/handmade-swift/pull/1 The final keywo
by josephlord 12y ago
This PR puts the Swift array on terms I think:
https://github.com/owensd/handmade-swift/pull/1 https://github.com/owensd/handmade-swift/pull/1
The final keyword means that at least one indirection is avoided for each access to the buffer. The speedup is significant. I do wonder if there is a way that the lookup could be cached though if the compiler was a bit smarter.
There is also the option of using a pure function rather than accessing the instance buffer for fairly similar performance (see: https://github.com/owensd/handmade-swift/pull/2 https://github.com/owensd/handmade-swift/pull/2)