IllusionMods / IllusionFixes

A collection of fixes for common issues found in games by Illusion
GNU General Public License v3.0
157 stars 29 forks source link

GarbageTruck: optimize the getter method for BaseProcess.data #29

Closed mosirnik closed 3 years ago

mosirnik commented 3 years ago

This just manually inlines GetComponentCache and its helper method to eliminate allocation. In my tests in free H, it reduces allocation by about 300KiB/s @ 60Hz.

Ideally I would patch GetComponentCache directly, but Harmony doesn't seem to let me patch a generic method without specializing it first.