Hi,<div>I am trying to implement a method of using a "batteries included" lisp image (ccl, linux, 64bit) which can be used for running a variety of lisp tasks in a batch mode. I chose to pre-load the image because it was just too slow to load the individual fasl files at run time, either via asdf or through a generated load-list.</div>
<div><br></div><div>I'm using ASDF to load a small system at run-time, but finding that even with small system (say, one file), performance is sluggish, over 2 seconds.</div><div><br></div><div>It looks like the problem crops up when there are many dependencies. Poking around the asdf code this appears to be because operate always traverses the system dependencies, and pokes the asd files to find if they have changed.</div>
<div><br></div><div>This makes sense for asdf in development mode, since it needs to discover changed systems. Not so good for a deployed system. </div><div><br></div><div>ASDF assumes that since the system def file has not changed, the system hasn't been changed either (I know there has been discussion of this assumption.) But lets assume that at least part of the reason for that is because it is very time consuming to check the entire set of files every time the developer wants to recompile and load just a single file.</div>
<div><br></div><div>Why not assume in a deployment mode that NO system will have changed if it is already loaded in memory, and unless the application has asked that it be reloaded? This would be for performance as well as for safety -- we really don't want dependency checking to result in any filesystem checks, etc.</div>
<div><br></div><div>I feel that this problem is really pushing my grokking of asdf, but I'm delving ahead anyway.</div><div><br></div><div>I haven't tested it extensively, but I did just waste a perfect sunday morning fiddling with this:</div>
<div><br></div><div>extended module with a slot "up-to-date-p", but surely there is a better name, this I just chose while in early play mode:</div><div><br></div><div>added these methods:</div><div><br></div><div>
<div>(defmethod operation-done-p ((o load-op) (c module))</div><div>  (module-up-to-date-p c))</div><div><br></div><div>(defmethod mark-operation-done ((operation load-op) (c module))</div><div>  (setf (module-up-to-date-p c) t))</div>
</div><div><br></div><div>tweaked the operate method so that it exits early if the module has been marked as up-to-date</div><div><br></div><div><div> (if (operation-done-p op system)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>  (return-from operate (values op nil)))</div>
</div><div><br></div><div>and do-traverse to only collect "kids" if it is not done</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">    </span>(unless (operation-done-p operation c)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                      </span>  (while-collecting (internal-collect)</div></div><div><br></div><div><br></div><div>Note that this code goes in the special section of operate for handling modules.</div>
<div><br></div><div>I think that is all that I did.</div><div><br></div><div>I found that the time to handle the require for my current project dropped from about 2 1/2 to about 1/2 second.</div><div><br></div><div>Thoughts? </div>