holylib_filesystem_searchcache
Description
If enabled, it will cause the filesystem to use a cache for the searchpaths.
When you try to open a file with a path like GAME
which has multiple searchpaths, it will check each one until its found.
Now, the first time it searches for it, if it finds it, we add the file and the searchpath to a cache and the next time the same file is searched for, we try to use our cache search path.
If the file doesn't exist, it will still go thru all search paths to search for it again!
I don't know if this has any bugs, but while using this for ~1 Month on a server, I didn't find any issues.
It will also improve the MOD
search path since it also has multiple search paths.
Example
This will improve file.Open
, file.Time
and file.Exists
.
The more searchpaths exist, the bigger the improvement for that path will be.
Example
You also can test it using the MOD
path. The performance of file.Exists
for any search path and MOD
should be somewhat near each other since,
it checks the same amount of searchpaths while this is enabled.