[solved] Large number of unused assets in game directory still slows down game
Posted: Fri Aug 25, 2023 1:43 am
So I encountered this issue today and potentially solved it already, but want to know why, and if it was known behavior or documented somewhere that I've just missed...
I have a large number of .json files in my game directory that contain some pre-computed lookup tables for the results of analysis that I'm displaying. I originally had these files (~1,000 files but only total about 17 MB combined) in a directory named ".data" and was easily hitting 60 fps. After some refactoring today I realized my fps had taken a hit and after a lot of debugging, I realized that having those same files in my game directory in a directory that doesn't begin with "." drops my fps by 20 or more, even when I've turned off the portion of the game that accesses those files.
I'm still not sure why, even when unused, I take such a hit on fps just by having those files present, but naming their directory something that begins with "." appears to be the solution. I'm guessing it omits that directory and it's children from some sort of filesystem indexing, but was hoping someone had more information.
Any ideas?
Thanks
I have a large number of .json files in my game directory that contain some pre-computed lookup tables for the results of analysis that I'm displaying. I originally had these files (~1,000 files but only total about 17 MB combined) in a directory named ".data" and was easily hitting 60 fps. After some refactoring today I realized my fps had taken a hit and after a lot of debugging, I realized that having those same files in my game directory in a directory that doesn't begin with "." drops my fps by 20 or more, even when I've turned off the portion of the game that accesses those files.
I'm still not sure why, even when unused, I take such a hit on fps just by having those files present, but naming their directory something that begins with "." appears to be the solution. I'm guessing it omits that directory and it's children from some sort of filesystem indexing, but was hoping someone had more information.
Any ideas?
Thanks