Skip to content

Refactor GenitalAdjusterComponent for better performance

surei requested to merge surei/rjw-genes-pe-patch:mapcomp-perf into main

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.

Merge request reports

Loading