TIL: in Swift, unowned variables aren’t free. They’ve got runtime checks so that your app crashes if the object has been deallocated instead of just barreling forward with invalid memory. Makes sense.
But using them in a method called inside a very tight loop, like, say, every APU tick for every sound channel on an NES…it adds up. I improved performance by about 25% by making them unowned(unsafe). Which is great…but nerve wracking 😬