I ran the Cywgin `xemacs'; I notice it's quite fast once it starts up but
dog-slow doing so.
I imagine much of the time is spent doing multiple stats down through the
package tree.
I'd like to suggest the following:
The basic idea is that upon first startup XEmacs remembers the package roots
and the contents and modification dates of all the directories it has to
traverse. Ideally this remembrance should be done in some system-wide place
but this may not be possible unless xemacs is running as `root' --
therefore, either we do this automatically when xemacs is run this way, or
we just do it using a flag, which can function as a way of a sysadmin
updating the cache. In other circumstances, use a file in ~/.xemacs.
Then, next time, use this cache instead of actually reading the directories.
However, go through each resulting directory in load-path and stat it to see
what the modification time is; if so, we need to discard the file listing
for that directory and reread it (thereby potentially adding new directories
to the cache that need to be recursed into, or removing directory trees from
the cache).
As far as I know, this algorithm/procedure has many advantages:
[a] simple
[b] 100% accurate
[c] relatively fast -- it requires that we stat only once per directory
instead of once per directory entry, plus three times extra per directory
(for default, default.el, default.elc), plus probably other overhead.
[d] allows but does not require the administrator to run a command to
generate the cache