Add option to flush assetcache on close to Preferences
taustinoc opened this issue · 4 comments
Is your feature request related to a problem? Please describe.
MapTool is extremely slow to open when there are thousand or tens of thousands of files in the assetcache folder. With ~20,000 files, my home computer takes up to 4 minutes for MapTool to open. If I manually delete everything in the assetcache folder first, it takes less than 20 seconds. Since it only happens to Windows users, I believe this is more due to how Windows handles loading directory information than anything to do with Java or how it interacts with Windows.
Describe the solution you'd like
A checkbox (defaulting to unchecked) to completely flush the assetcache folder when MapTool closes to the Preferences screen, probably on the Application tab.
Describe alternatives you've considered
The only other alternative that has occurred to me would be to flush the assetcache on startup, before reading the directory information, but that seems pointless.
It looks like @kwvanderlinde has put in a fix for the slow cache issue: #2987
Which looks to show a speed increase of about 30x on a 9.3 gig/100,000 file test cache (if I'm reading the test case correctly): #2887
It looks like @kwvanderlinde has put in a fix for the slow cache issue: #2987
Yes, this feature request will probably be obsolete with 1.10.
Which looks to show a speed increase of about 30x on a 9.3 gig/100,000 file test cache (if I'm reading the test case correctly): #2887
The test case you're referencing only covers the size calculation shown in the asset cache and image cache status bars. That is indeed a 30x improvement in my case. But the much more important change is the removal of the filesystem watcher - that entirely eliminates the minutes-long wait.
That makes me very happy. Far better to fix the problem than cobble together a workaround.
If we agree that this feature is no longer necessary, we can close this issue.