4 ms·
I learned to code in the 8-bit days where you'd count to 1000 in a BASIC for loop to create a significant delay. I guess I've not got out of the mindset that do
by bluescrn 3y ago
I learned to code in the 8-bit days where you'd count to 1000 in a BASIC for loop to create a significant delay. I guess I've not got out of the mindset that doing anything 1000x is quite a lot (particularly when you're aiming to do it 60 or more times per second).
But as somebody working in Unity (and often on mobile), there's still many cases where 1000 of something is a lot, and should perhaps be cause to rethink your approach. For example 1000 draw calls, 1000 UI elements, 1000 instances of even the most simple prefab.
1000 raycasts per frame is also something that I'd try to avoid. But if they seemed important, you've just got to try it and profile it. Nobody can answer 'what is the cost of 1000 raycasts?' without a fair bit more information.
- db48x 3y agoI agree that profiling is the ultimate arbiter.