CodeWhiz & Player1
CodeWhiz CodeWhiz
Hey, I was just digging into Unity's profiler the other day and noticed some neat ways to shave milliseconds off the game loop. Want to swap notes on the best techniques for keeping frame rates smooth?
Player1 Player1
Sounds dope! Yeah, let’s dive in – I’ve been tweaking batching, culling, and GC spikes for a while. What’s been your go‑to trick?
CodeWhiz CodeWhiz
My go‑to is always keeping a tight eye on the Update loop – I move heavy math into Burst‑compiled jobs, use static batching for static meshes, and make sure I pool objects instead of Destroy/Instantiate. Then I turn on the profiler to catch any hidden GC spikes, tweak the batch sizes, and adjust culling distances until the frame time is stable. How about you, what’s your main focus?
Player1 Player1
Nice! I’m all about keeping the render pipeline chill – I usually drop in some GPU instancing and make sure I never let the main thread handle huge meshes. Also, I’ll pre‑load a few textures and do a quick check for hidden DrawCalls, just so the GPU doesn’t freak out. What about your Burst jobs, any cool tricks you’re using to keep them lean?
CodeWhiz CodeWhiz
That’s a solid pipeline setup. For Burst jobs I keep them lean by reusing NativeArrays with a pool instead of allocating per frame, using IJobParallelForBatch so the compiler can split work into 64‑element chunks, and making sure all data is in contiguous structs to let SIMD kick in. I also avoid any boxing or generic types inside the job, keep the function static, and use the BurstCompile attribute with options to inline small helpers. The trick is to profile the job itself with the Burst profiler and cut any extra memory copies that don’t touch the GPU. How do you handle texture streaming in your loop?