Added August 2015
To help alleviate the performance overhead when many image files or icons are loaded from a network file server, images may be automatically cached on the local workstation provided the following:
• The environment variable ASWCACHE is defined and points to a valid directory. The directory will be created if it doesn't exist, provided the parent directory exists. It can be anywhere, but obviously should be on a local drive.
• The operation of loading the image file into memory takes more than 10 ms. This has been determined by limited testing as a reasonable threshhold between typical performance of local disks and that of network disks.
• AUI_CONTROL will automatically check the cache first whenever it creates an image control, eliminating the overhead of reloading the file over the network if it is cached locally.
Comments
Since the images are auto-cached as used, and auto-removed from the cache on exit, there is no need for any special management on the application's part—i.e. for manually syncing from the file server to the local workstation. However, since the benefit of the cacheing occurs starting with the second load of each image, it is only useful in applications which repetitively load the same images or icons, from a file server, many times during a session.
An easy way to set the environment variable is via the MX_SETENV function, or SETENV.LIT, e.g.
.SETENV ASWCACHE=C:\VM\MIAME\CACHE
Warning: Since the cache directory is cleared on exit, you must be careful not to use a directory containing permanent files!!!!!!!!!
You can trace the cache logic by activating the FOPENS trace option. It shows the search operations, and also records how long the image load operation takes; look for "loadandresizex" in the ashlog.log or debug message window, e.g.in the following, the load takes just over 16 ms (16001 microseconds), and thus would be auto-cached if the cache is defined.
loadandresizex (\\SERVER\icons\BETA\clock.png), rc=0, himg=78dfd0 [16001 us]
History
2015 June, A-Shell 6.1.1412: Add new enviornment variable to A-Shell