emacs-devel
[Top][All Lists]
Advanced

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

Re: Slow Info startup


From: Juri Linkov
Subject: Re: Slow Info startup
Date: Thu, 01 Dec 2005 23:47:54 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>     When you browse around, your Info history will be recorded as
>     though you are visiting the real "elisp" info file, at
>     /usr/share/info/elisp or wherever.  If you later visit the
>     "real" info file, those links will be fontified as "previously
>     visited" links.  Maybe that's an acceptable situation, however.
>
> Maybe it is acceptable, but first, could you explain why you think
> this is the best solution?
>
> Why is removing the directory related to making this code faster?

The Info history contains absolute file names.  Menu items and
cross-references contain only file names without directory part.
Info uses the history to decide how to fontify visited references:
if the file name (and node name) of a menu item or cross-reference
exists in the history then it is fontified with `info-xref-visited'.

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.  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.  `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.  The `dir' node usually contains hundreds of
menu items with non-absolute file names in parens, so `Info-find-file'
gets called on each of them during fontification in the new code.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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