Custom Tick rate/Game optimization

Exactly what I proposed in my 2nd solution less branches.

While a branch prediction failure, can have it’s costs, there is no way around it, unless one just doesn’t code up any branches at all.

First solution had N to N branches :slight_smile:
Your solution if I understood correctly N/2 branches (but applicable only to even/odd case).
The Not Silver Bullet :wink: would have 1 branch for all groups (of-course in even/odd case 1 = 2/2).

Yes probably wiki wasn’t the best link → but it suggests to a detail of a branch:
When branch predictor makes a guess it caches the subsequent commands in to L# cache.
Misprediction leads to flushing the Cache and loading the commands again which is very taxing in a real world situation).

IMO this SO illustrates it the best:

https://stackoverflow.com/questions/11227809/why-is-it-faster-to-process-a-sorted-array-than-an-unsorted-array/11227902