Currently all inputs are incredibly inefficient. They loop through 1000s of nodes every frame just to find the relevant input to process. This wasn't so bad when we had a separate inputs store state slice, but now everything is nodes it would be wise to come up with a cacheing strategy.
I see two approaches:
- We manually add/remove input Ids from an array in state when the relevant input nodes are added/removed. We could even have separate arrays for each input type. This would work, just requires some careful logic ensuring the lists are kept up to date
- Some automatic system. We keep an eye on the store for changes and do a one time pass on it, building a fresh set of IDs each time. This keeps our adding/removing logic tidier at some performance cost.
- Leave as is. We're looping through 1000s of nodes, but not doing any sort of processing on most of them...
Currently all inputs are incredibly inefficient. They loop through 1000s of nodes every frame just to find the relevant input to process. This wasn't so bad when we had a separate
inputsstore state slice, but now everything is nodes it would be wise to come up with a cacheing strategy.I see two approaches: