Neverball / neverball

Tilt the floor to roll a ball through an obstacle course before time runs out.
https://neverball.org
Other
342 stars 78 forks source link

Constant I/O access ingame #61

Open libcg opened 10 years ago

libcg commented 10 years ago

On the Playstation Portable, I had very low framerates ingame, while it was (mostly) fine in the menu. The Memory Stick was accessed a lot because the corresponding LED was always blinking.

After commenting out this line https://github.com/Neverball/neverball/blob/master/ball/game_client.c#L335 everything went fine.

It might be a non-issue on PC because of the writeback cache.

parasti commented 10 years ago

This is occasionally noticeable, enough to be annoying and in certain situations it totally destroys the game experience, like when the player has spent the last hour beating a level or a high-score.

Nuncabola does replay writing asynchronously.

http://forum.nevercorner.net/viewtopic.php?pid=26265#p26265

senquack commented 9 years ago

I am working on a port of Neverball to the GCW Zero, and am glad you posted this issue, libcg. We lack a good SD-card driver for now, and don't have DMA enabled yet. Even without the performance issue, this writing-by-default of replays to a file in your home directory would have caused unnecessary wear on our internal SD card. Perhaps a good easy solution for now on Linux builds would be for Neverball to instead make the temporary replay file exist the /tmp/ directory. It is usually mapped into RAM and is a better place to put things like this anyways, in my opinion. This would also prevent premature wear to a solid-state disk, when a user has their home directory on one.

camthesaxman commented 6 years ago

If your build uses the physfs backend, it does buffer the writes so that the replay I/O doesn't interfere with game performance. https://github.com/Neverball/neverball/blob/master/share/fs_physfs.c#L151

I haven't really had issues with this. The only stall I seem to have is occasionally when loading sound files, particularly the level complete sound. I've had times where I just entered the goal, and then the game hangs for about one second before playing the sound. This doesn't happen often, though, so it doesn't bother me much.