[asdf-devel] Performance hit in TRUENAMIZE

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Thu Jul 15 21:18:06 UTC 2010

On Thu, Jul 15, 2010 at 12:59 AM, Faré <fahree at gmail.com> wrote:

> we use TRUENAME + HANDLER-CASE precisely because the file (or
> directory, most of the time) doesn't necessarily exist and we're
> trying to fully resolve any symlinks along the path, so that in the
> end we may apply translations to normalized pathnames.

But Rene,  (ignore-errors (return (truename p))) = (probe-file p) with the
difference that the latter can be implemented much more efficiently.

TRUENAME has a cost that is proportional to the number of directory
components and to this you must add the cost of establishing a handler-bind
and the jump outside the function due to the error.

PROBE-FILE first probes the existence of the file, which can be done with a
*single* system call. No error handling is required: if the file does not
exist, nothing else is done, but if the file exists, then its truename is
returned -- as per TRUENAME, with symlinks resolved.

Am I missing something?


Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20100715/fa965fc6/attachment.html>

More information about the asdf-devel mailing list