Object Pooling Didn’t Fix My Audio Spike. The Import Settings Did.
TL;DR A 5-minute music track set to Decompress On Load froze the main thread for about 390 ms on every cold play, in a Development Build. Switching the clip to Compressed In Memory or Streaming brought the worst frame down to about 2 ms. Object pooling the AudioSource made the play call about 0.02 ms faster, which is real but irrelevant to that spike. Background I […]
Read More
renderer.material vs MaterialPropertyBlock in URP
TL;DR In URP, coloring 10,000 cubes with a single cached MaterialPropertyBlock was about 6× slower than using renderer.material in my test. The property block saved roughly 10,000 Material objects, but it pushed every cube out of the SRP Batcher: SetPass calls went from 46 to 20,024. renderer.material has a real cost too. It clones one […]
Read MoreSwallowing vs. Re-throwing OperationCanceledException in UniTask
The question If you catch OperationCanceledException in a UniTask step and don’t re-throw it, the rest of the chain keeps running and the whole sequence reports success. I’d read that rule many times, but I wanted to see it happen in my own console, with timestamps and frame numbers as evidence. This post is the record of […]
Read More