js-dos icon indicating copy to clipboard operation
js-dos copied to clipboard

High CPU Usage

Open Ser-Gen opened this issue 4 years ago • 4 comments
trafficstars

Much higher than in emularity / em-dosbox. Same in other games.

Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz Chrome 92.0.4515.159 incognito, single clear tab.

archive, 3-7%. https://archive.org/details/msdos_Supaplex_1991 image

Dos.zone, 30% flat. https://dos.zone/rep/my/supaplex-1991%40supaplex.jsdos%3AdyGABtcYCqDrqAMwb5YmXn0pXbH image

Ser-Gen avatar Aug 18 '21 19:08 Ser-Gen

Same even when I use simple direct calling without ui.

emulators.dosboxDirect(new Uint8Array(bundle));

Ser-Gen avatar Aug 19 '21 09:08 Ser-Gen

Correct. This is not a bug, emulation work in worker and trying to utilize 100% of available resources to achieve max performance. Event if you set to emulate 300 cycles it does not matter. Of course it can be changed to sleep/awake behavior but I think it not sense, because usually games want to max cycles. So wan't fix for now.

caiiiycuk avatar Aug 23 '21 03:08 caiiiycuk

it's sad, on a mobile it will quickly drain the battery.

Ser-Gen avatar Aug 23 '21 03:08 Ser-Gen

Depends on browser. It's not a native code, browser can control how much CPU spend to execute code. However, this affects only very old games, that not require high performance. It can be fixed, but need to do it very accurate to not slowdown the emulator.

caiiiycuk avatar Aug 23 '21 05:08 caiiiycuk