Tag: Optimization
All the articles with the tag "Optimization".
What Made GC Long Wasn't the Cache Size, It Was the Pointer Count
Discord's Go-to-Rust post diagnoses the problem accurately, and the diagnosis still holds. But only two knobs got turned. GOGC sets frequency and cache size cuts the hit rate. The variable that sets scan cost is the pointer count, and Go doesn't scan pointer-free objects at all.
SetActive(false) Doesn't Pause a Coroutine, It Ends It
The clipping's ObjectPool implementation uses the official API correctly. But OnGet and OnRelease are one line each. It does none of the six things the manual says to reset on release, and the coroutine SetActive(false) ended doesn't come back when you re-enable.
OverlapCapsule's point0 and point1 Are Not the Capsule's Ends
The docs call point0 'the center of the sphere at the start of the capsule.' That's the center of the end cap, not the tip. Read it as the tip and your capsule grows by twice the radius.
OverlapSphere Doesn't Ignore the Ignore Raycast Layer
Same Physics class, different default layer masks for Raycast and OverlapSphere. An object you parked on Ignore Raycast to keep it out of queries still shows up in OverlapSphere.