algernon-A / TransferController

MIT License
7 stars 3 forks source link

No reflection in per frame methods. #5

Closed DaEgi01 closed 2 years ago

DaEgi01 commented 2 years ago

You should remove reflection from per frame methods like MatchOffer. Performance will tank otherwise! Try https://harmony.pardeike.net/api/HarmonyLib.AccessTools.FieldRef-2.html instead :) This creates either refs or deleteges in order to get and set fields or methods instead of reflection. This is still somewhat slower than direct field access but like 10x faster than reflection.

algernon-A commented 2 years ago

The reflection is only there for 0.1 to keep things simple and make sure everything is working before implementing the transpiler in 0.2 (even faster than refs/delegates!)

algernon-A commented 2 years ago

BTW, the medium-term approach is to use separate threads.

algernon-A commented 2 years ago

Initial placeholder transpiler implemented in 84796459c27b316e84ebcf878c0f557be7e70137