Refactor GenitalAdjusterComponent for better performance
Refactor GenitalAdjusterComponent for better performance.
- Run every 20 ticks rather than every tick.
- Only evaluate pawns that have spawned since the last run.
- Do not evaluate unspawned pawns.
- Store genital hediffs in a dictionary keyed by gene name for fast lookup.
Testing on a map with 40 human pawns, average runtime per tick is reduced from 0.360 ms to 0.027 ms.