SHSGames / shsgames.github.io

Unblocked Games
https://shsgames.github.io/
Other
116 stars 460 forks source link

Slow #317

Open ethanaobrien opened 2 years ago

ethanaobrien commented 2 years ago

Hello, I think your project is really cool! One problem. The emulation speed is -- really slow and really heavy on cpu.

Why its slow:

browser <= WebAssembly (ruffle) <= system emulation

As an analogy, you are basically running a virtual machine within a virtual machine, causing it to be really slow. I have one simple change that would also allow you to no longer have to re-compile each game separately.

Solution: use this. It is a direct compilation of retroarch to the web browser with a neat UI

I own an easily to embed emulator which would save lots of work. It also has netplay implementation! It also support things like the nintendo 64 and the nintendo ds! Please look into it.

hello-smile6 commented 2 years ago

v86 would be better. It can get several hundred million instructions per second, unlike alternatives. https://github.com/copy/v86

ethanaobrien commented 2 years ago

v86 is for full scale operating systems, so youd have to completely re-write the emulator to run as if you booted from it.

It would still have that extra loop. V86 is a webassembly virtual machine. Youd be doing the same thing you currently have

hello-smile6 commented 2 years ago

v86 is for full scale operating systems, so youd have to completely re-write the emulator to run as if you booted from it.

It would still have that extra loop. V86 is a webassembly virtual machine. Youd be doing the same thing you currently have

Actually, v86 works far better than you'd think. Download a Ubuntu 16 disk image and try it. You'll be surprised.

ethanaobrien commented 2 years ago

I know what v86 is, I managed to boot windows vista in V86. You dont seem to understand what it is.

browser <= WebAssembly <= os virtual machine

It runs a virtual machine. There arent many emulators written in computer os 32 bit assembly. It would also be very difficult to save/load state and cheats/other things if there were.

It still is running that extra step, my emulatorjs project is an application running directly in the browser, no extra step.

hello-smile6 commented 2 years ago

I know what v86 is, I managed to boot windows vista in V86. You dont seem to understand what it is.

browser <= WebAssembly <= os virtual machine

It runs a virtual machine. There arent many emulators written in computer os 32 bit assembly. It would also be very difficult to save/load state and cheats/other things if there were.

It still is running that extra step, my emulatorjs project is an application running directly in the browser, no extra step.

Well, v86 can save the state and restore it instantly. Also, you can run almost anything on Arch. Try it.

ethanaobrien commented 2 years ago

I have tried it, this would be another step to run the vm, slower than what you currently has.

browser <= WebAssembly <= os virtual machine <= emulator

Instead of me trying arch linux, why dont you try my emulator?

hello-smile6 commented 2 years ago

I have tried it, this would be another step to run the vm, slower than what you currently has.

browser <= WebAssembly <= os virtual machine <= emulator

Instead of me trying arch linux, why dont you try my emulator?

I will...