Baekalfen / PyBoy

Game Boy emulator written in Python
Other
4.57k stars 472 forks source link

Use integer subtraction over modulo arithmetic for a slight speed boost #288

Closed thatguy11325 closed 9 months ago

thatguy11325 commented 9 months ago

I doubt self.clock or self.clock_target ever exceeds 2*FRAME_CYCLES. In testing, this change showed a 3-6% speed increase assuming the screen is being rendered every tick.

Baekalfen commented 9 months ago

I tried benchmarking some more, but it didn't seem to work