Skip to content

Cache input Ids #630

Description

@funwithtriangles

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:

  1. 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
  2. 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.
  3. Leave as is. We're looping through 1000s of nodes, but not doing any sort of processing on most of them...

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions