naTmeg / ScriptedAmigaEmulator

Amiga Emulator in javascript and HTML5
331 stars 63 forks source link

Perfomance in scaleplay function #15

Closed Intexk closed 7 years ago

Intexk commented 7 years ago

Improves the perfomance of that function by caching some values that doesn't change during loop.

mithrendal commented 7 years ago

Hi @Intexk , do you think that it makes sense to look for other hotspots as well to improve the execution performance of the emulator? Background: It runs just well on an A9 processor under iOS. A bit more performance capacity is always welcome to save battery consumption. Anyway thank you!!

Intexk commented 7 years ago

In the tests i did in my laptop....cpu emulation (runNormal function) was 500 miliseconds...and scaleplay function alone was 160 miliseconds during a period of 5 seconds....after the change it went about 0.6 miliseconds.

naTmeg commented 7 years ago

Hi Intexk,

thanks for the testing, let's use this code.