(02-22-2015, 05:21 PM)rama Wrote: Do you have tests to verify this, avih?
It would be nice to see how tweaks like this affect the gameplay experience, and not only for compressed images but regular reads as well.
I wonder if there's some system monitor application that can track file accesses together with cache hits / misses.
It doesn't affect normal reads at all - it only happens for compressed files.
The normal reads already use similar system, but with the compressed files it was harder to implement, so until now it didn't have it.
The current implementation for compressed files is sort of a hack, but a very reasonable one. We might still improve it in the future, but from my tests (which are tedious since many tests require reboots to make sure the OS cache is clean) it shows considerable improvement.
Also, while the tests showed clear improvement when the chunks were not at the OS cache yet, they didn't show performance regression when the chunks were already cached. So it's a win-win.
Also, the prefetch is asynchronous and quite tiny anyway - 256k and only happen after we actually extract a chunk from the compressed file (which is not very frequent since the internal cache already has the data most of the time anyway - so we don't need to actually access the disk and extract it).
It's easy to test how the patch affects cases where the data is already cached by the OS: just run the game with the compressed iso with and without the patch and see if one performs better than the other.
But to test if it actually improves the case where the data is not cached by the OS, you'll most probably have to reboot before each try, and even then run the game only once, because by the second time you run it the data is already likely to be cached by the OS.