[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow Info startup

From: Richard M. Stallman
Subject: Re: Slow Info startup
Date: Fri, 02 Dec 2005 13:21:47 -0500

    The old code uses `file-name-nondirectory' to remove directory part
    from absolute file names in the history before comparing them to the
    name extracted from a menu item or cross-reference.

In general, that could make a mistake.

                                                         The new code uses
    `Info-find-file' to find the absolute file name of a menu item
    or cross-reference before comparing it to absolute file names in
    the history.

In general, that is more correct.

      `Info-find-file' is a quadratically slow function that
    iterates over `Info-directory-list' and `Info-suffix-list' to find the
    absolute Info file name.

Indeed, this is slow.  Would it solve the problem to maintain a cache
that records arguments that were given to Info-find-file together with
the results that were obtained?

Or is even one call for each file too slow?

Another idea: get the directory lists of the directories in
Info-directory-list.  Then Info-find-file can do its work without
actually trying to open the files, by scanning those lists instead.
Maybe that would be both fast enough and 100% correct.

Yidong wrote:

    Actually, we only need to use file-name-nondirectory for Info node
    names specifying other info files.  This way, links within info files
    will always be highlighted correctly, even for info session started
    with Info-on-current-buffer (external links will still have the flaw
    discussed previously).

Both methods could be speeded up this way.  If you use this technique
to optimize the Info-find-file method, does that make it fast enough?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]