sinshu / managed-doom

A Doom port written in C#
408 stars 62 forks source link

Avoid allocating a struct for each + and * operation. 15% FPS increase #31

Closed Henr1k80 closed 1 year ago

Henr1k80 commented 1 year ago
sinshu commented 1 year ago

Thank you for the PR. Your optimization indeed improves performance during the execution of JIT-compiled code, but it seems to have no effect on the execution of AOT-compiled code.

Here are the results from my environment:

Average FPS over three runs:

Henr1k80 commented 1 year ago

Oh, I tested by just making release builds, I presumed that made AoT... I can confirm your numbers with AoT, my changes are slower. I just tried removing the readonly modifiers and that makes it less slow, but still slower. Crazy difference in JIT vs. AoT