Swift Weak Reference Much Slower than Strong Reference
问题 I'm building a physics engine in Swift. After making some recent additions to the engine and running the benchmarking tests I noticed the performance was drastically slower. For example, in the screenshots below you can see how the FPS dropped from 60 to 3 FPS (FPS is in the bottom-right corner). Eventually, I traced the problem down to just a single line of code: final class Shape { ... weak var body: Body! // This guy ... } At some point in my additions I added a weak reference from the