The implementation is allowed to either eagerly compute the information
from the configurations and file system, or to lazily re-compute it
every time, or to cache any part of it as it goes.
In practice, the recommended
source-registry eagerly collects and caches results
and you need to explicitly flush the cache for change to be taken into account,
whereas the old-style
*central-registry* mechanism queries the filesystem every time.
To explicitly flush any information cached by the system
after a change was made in the filesystem, See Configuration API,
and e.g. call
Starting with ASDF 3.1.4, you can also explicitly build a persistent cache
of the .asd files found under a tree:
when recursing into a directory declared by
:tree and its transitive subdirectories,
if a file .cl-source-registry.cache exists containing a form
that is a list starting with
:source-registry-cache followed by a list of strings,
(:source-registry-cache "foo/bar.asd" "path/to/more.asd" ...),
then the strings are assumed to be
the available asd files under that tree, and the recursion otherwise stops.
The list can also be empty, allowing to stop a costly recursion in a huge directory tree.
To update such a cache after you install, update or remove source repositories,
you can run a script distributed with ASDF:
To wholly invalidate the cache, you can
delete the file .cl-source-registry.cache in that directory.
In either case, for an existing Lisp process to see this change,
it needs to clear its own cache with e.g.
Developers may safely create a cache in their development tree,
and we recommend they do it at the top of their source tree if
it contains more than a small number of files and directories;
they only need update it when they create, remove or move .asd files.
Software distribution managers may also safely create such a cache,
but they must be careful to update it every time they install, update or remove
a software source repository or installation package.
Finally, advanced developers who juggle with a lot of code
source-registry may manually manage such a cache,
to allow for faster startup of Lisp programs.
This persistence cache can help you reduce startup latency.
For instance, on one machine with hundreds of source repositories,
such a cache shaves half a second at the startup
#!/usr/bin/cl script using SBCL, more on other implementations;
this makes a notable difference as to
their subjective interactivity and usability.
The speedup will only happen if the implementation-provided ASDF is recent enough
(18.104.22.168 or later); it is not enough for a recent ASDF upgrade to be present,
since the upgrade will itself be found but
after the old version has scanned the directories without heeding such a cache.
To upgrade the implementation-provided ASDF,
use our script