Forum OpenACS Q&A: Re: Down to < 60 seconds
Probably but I was able to get the startup to a very reasonable speed with a very simple and easy to test change.
It was not clear exactly why it was setup this way. It would require a little more work. ie: Tcl library files only load from /tcl/ under a package. XQL files can be anywhere. Tcl/Adp page scripts and includable pages should not need to be loaded by the APM but the corresponding XQL files would.
So I think overall making the code smarter would be good but much more complex and time consuming to test and the simple change seems to be enough for at least my site.
after looking more deeper into the code, i see what you mean. The apm-loader is quite dumb and is based on the assumption that load more or less everything and filters later on. However, one can do better than what the above check does: instead of loading all files int the directory www/resources and filter these, one can already filter on the directory and avoid scanning all these files at all.
But there seems to be more useful, since several of the operations scan the files, and it is not useful to scan e.g. .zip files, or .java, etc. Furthermore, acs-lang was loaded twice.
Since the files are scanned several times during startup, it seems worth to speed it up (see my commits of today). On my test machine, some of the apm_load* operations are up to five times faster than before. The code is still straightforward. In case my filtering was too aggressive (e.g. on file extensions), it can be easily made more/less aggressive.
Before the change: startup time 14 secs
[02/Apr/2013:17:24:44][32182.7f763a747780][-main-] Notice: nsmain: NaviServer/4.99.5 starting [02/Apr/2013:17:24:58][32182.7f763a747780][-main-] Notice: nsmain: NaviServer/4.99.5 runningAfter the change: startup time 9 secs
[04/Apr/2013:12:11:36][8407.7ff48ba4c780][-main-] Notice: nsmain: NaviServer/4.99.5 starting [04/Apr/2013:12:11:45][8407.7ff48ba4c780][-main-] Notice: nsmain: NaviServer/4.99.5 running
It should work now if you apply that last commit.
I double checked and all scripts within the sql/upgrade directory were being unintentionally ignored.