Post subject: (SNES) "Use Ring Buffer IO" option seems to cause slowdown
Editor, Expert player (2078)
Joined: 6/15/2005
Posts: 3282
It seems that SNESHawk's "Use Ring Buffer IO", which is on by default, is the apparent cause of massive slowdown in SNES. It has been reported at least once. I don't know what that option is supposed to do, but when it is on, the emulation speed drops to less than 1 fps in my case. Turning it off restores emulation speed to about 30 fps. This is also the apparent cause of 1.4.0's presumed speed superiority in SNESHawk, because "Use Ring Buffer IO" was first implemented in 1.4.1. (I don't presume this anymore, but for a while, I was recommending 1.4.0 for SNES over more recent versions.) So, if SNESHawk runs extremely slowly on your system, try turning off this option (when SNES ROM is loaded: SNES -> Options -> uncheck "Use Ring Buffer IO"). I don't know if anyone else has a different case (where this option improves speed or something).
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
Its possible that the ring buffer method will dysfunction on systems with less than 4 cores. I probably should have wrote that in the config box. The ring buffer method causes bizhawk to go into a busy loop doing rx/tx to libsnes. Libsnes will be running on its own thread. You'd have to have at least two cores for this to work without total failure. Then, bizhawk is polling its input in another thread; and lately, rewind runs in its own thread if you tell it to. So you can see, there might be trouble. It is a performance increase for some people. It depends also on how fast the game is running. It has different characteristics at different framerate. Theres also some related optimizations which havent been done yet.
Patashu
He/Him
Joined: 10/2/2005
Posts: 4044
Can Bizhawk be made smart enough to know whether to use it or not? e.g. check number of cores on user's CPU, if it's greater than 3 turn ring buffer I/O on else turn it off, and if the user has changed it personally respect their choice.
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
Patashu wrote:
Can Bizhawk be made smart enough to know whether to use it or not? e.g. check number of cores on user's CPU, if it's greater than 3 turn ring buffer I/O on else turn it off, and if the user has changed it personally respect their choice.
Detecting the number of CPU cores is very doable: http://stackoverflow.com/questions/1542213/how-to-find-the-number-of-cpu-cores-via-net-c
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Warepire wrote:
Detecting the number of CPU cores is very doable
Indeed:
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3574)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
Patashu wrote:
Can Bizhawk be made smart enough to know whether to use it or not? e.g. check number of cores on user's CPU, if it's greater than 3 turn ring buffer I/O on else turn it off, and if the user has changed it personally respect their choice.
These reason it doesn't currently do this is because we don't know for sure this is what will happen. The assumption is that the optimal choice is 2 cores = don't use it, 3+ = use it. But it will take more people trying it and posting the results to know this. Until then, it is just an assumption that is probably inconsistent at best.
It's hard to look this good. My TAS projects