* Re: Why doesn't Info `T' cache node tree for current file?
2008-06-11 0:02 ` Juri Linkov
@ 2008-06-11 0:55 ` Miles Bader
2008-06-11 3:18 ` Drew Adams
2008-06-11 1:16 ` Stefan Monnier
` (2 subsequent siblings)
3 siblings, 1 reply; 16+ messages in thread
From: Miles Bader @ 2008-06-11 0:55 UTC (permalink / raw)
To: Juri Linkov; +Cc: Eli Zaretskii, Drew Adams, emacs-devel
Juri Linkov <juri@jurta.org> writes:
> I see one problem: how to refresh
> the cached TOC buffer when the Info file changes - the usual key `g'
> for buffer refreshing is already allocated to `Info-goto-node'.
If it's an issue, it should be done automatically, not by user action.
It seems simple enough to cache a timestamp and do a compare when the
user types "T" ...
-Miles
--
Immortality, n. A toy which people cry for, And on their knees apply for,
Dispute, contend and lie for, And if allowed Would be right proud
Eternally to die for.
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: Why doesn't Info `T' cache node tree for current file?
2008-06-11 0:55 ` Miles Bader
@ 2008-06-11 3:18 ` Drew Adams
0 siblings, 0 replies; 16+ messages in thread
From: Drew Adams @ 2008-06-11 3:18 UTC (permalink / raw)
To: 'Miles Bader', 'Juri Linkov'
Cc: 'Eli Zaretskii', emacs-devel
> > I see one problem: how to refresh
> > the cached TOC buffer when the Info file changes - the usual key `g'
> > for buffer refreshing is already allocated to `Info-goto-node'.
>
> If it's an issue, it should be done automatically, not by user action.
Agreed.
> It seems simple enough to cache a timestamp and do a compare when the
> user types "T" ...
Why a timestamp? What kind of "file changes" are we talking about? (See my
replies to others about this.)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Why doesn't Info `T' cache node tree for current file?
2008-06-11 0:02 ` Juri Linkov
2008-06-11 0:55 ` Miles Bader
@ 2008-06-11 1:16 ` Stefan Monnier
2008-06-11 3:18 ` Drew Adams
2008-06-11 3:17 ` Drew Adams
2008-06-11 3:20 ` Eli Zaretskii
3 siblings, 1 reply; 16+ messages in thread
From: Stefan Monnier @ 2008-06-11 1:16 UTC (permalink / raw)
To: Juri Linkov; +Cc: Eli Zaretskii, Drew Adams, emacs-devel
>> Anyway, no _need_ to do anything. My thought was that if someone uses
>> `T', s?he is likely to do so again, and likely with the same
>> file. Since we have gone to the trouble of building the node tree
>> (graph), why not save it for possible reuse? That's all.
> It is not very quick, since the code has to reread all Info subfiles
> (its slowest part). When the delay after typing `T' is more than 1 sec,
> this is unbearable for many users.
I haven't heard any complaint about it, so it looks like those delays
rarely if ever occur. And I believe machines are getting faster more
quickly than manuals are getting larger, so I don't expect reports to
become much more frequent in the future.
OTOH, such caching might be necessary for Drew's breadcrumbs (a small
delay is fine for `T' but is problematic if it occurs at every page).
> So we could cache the TOC buffer per Info file, if this costs us
> nothing. I see one problem: how to refresh the cached TOC buffer when
> the Info file changes - the usual key `g' for buffer refreshing is
> already allocated to `Info-goto-node'.
The refresh should be 100% automatic by recording the timestamps of
the files.
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: Why doesn't Info `T' cache node tree for current file?
2008-06-11 1:16 ` Stefan Monnier
@ 2008-06-11 3:18 ` Drew Adams
0 siblings, 0 replies; 16+ messages in thread
From: Drew Adams @ 2008-06-11 3:18 UTC (permalink / raw)
To: 'Stefan Monnier', 'Juri Linkov'
Cc: 'Eli Zaretskii', emacs-devel
> I haven't heard any complaint about it, so it looks like those delays
> rarely if ever occur. And I believe machines are getting faster more
> quickly than manuals are getting larger, so I don't expect reports to
> become much more frequent in the future.
>
> OTOH, such caching might be necessary for Drew's breadcrumbs (a small
> delay is fine for `T' but is problematic if it occurs at every page).
I don't see any performance problem. Can you refer to a specific scenario, so we
can talk concretely if there is really a performance problem?
> > So we could cache the TOC buffer per Info file, if this costs us
> > nothing. I see one problem: how to refresh the cached TOC
> buffer when
> > the Info file changes - the usual key `g' for buffer refreshing is
> > already allocated to `Info-goto-node'.
>
> The refresh should be 100% automatic by recording the timestamps of
> the files.
See my replies to others. What kind of file changes are we talking about: (a)
change of the file on disk or just (b) change by the user to visit a different
file?
Why would we worry about (a)?
For (b), why wouldn't we just associate the file name with the cache?
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: Why doesn't Info `T' cache node tree for current file?
2008-06-11 0:02 ` Juri Linkov
2008-06-11 0:55 ` Miles Bader
2008-06-11 1:16 ` Stefan Monnier
@ 2008-06-11 3:17 ` Drew Adams
2008-06-11 9:27 ` Juri Linkov
2008-06-11 3:20 ` Eli Zaretskii
3 siblings, 1 reply; 16+ messages in thread
From: Drew Adams @ 2008-06-11 3:17 UTC (permalink / raw)
To: 'Juri Linkov'; +Cc: 'Eli Zaretskii', emacs-devel
> > My thought was that if someone uses `T', s?he is likely
> > to do so again, and likely with the same file. Since we
> > have gone to the trouble of building the node tree
> > (graph), why not save it for possible reuse? That's all.
>
> It is not very quick, since the code has to reread all Info subfiles
> (its slowest part).
That was my thinking - it really does seem to do quite a lot of work.
On the other hand, at least with the manuals I use (Emacs and Elisp), it seems
pretty snappy to me. Do you really see a performance problem, or is this just
hypothetical?
> When the delay after typing `T' is more than 1 sec, this is
> unbearable for many users.
Whoa! That certainly would be unbearable. I don't see anything like that. It
seems instantaneous, to me (which surprises me, since it does all of the
`Info-goto-node' stuff).
Can you give a recipe (e.g. which manual)?
> So we could cache the TOC buffer per Info file, if this costs
> us nothing.
Either the TOC buffer or the node list, depending on performance needs etc.
> I see one problem: how to refresh the cached TOC buffer when
> the Info file changes
Do you mean when you go to a different manual (different file), or do you mean
when someone changes the file on disk?
I think we can ignore the latter (no?).
And I think the former would be easy to take care of. As I see it (and I think I
said this), the file name would be associated with the cached node list (or
buffer). When the current file is different and you hit `T', a new TOC is built.
Should we keep caches already built for previously visted files or just toss
them? Could be a user option - users with lots of resources might opt for
multiple caches; others not.
> - the usual key `g' for buffer refreshing is already
> allocated to `Info-goto-node'.
No - it should be automatic - see above.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Why doesn't Info `T' cache node tree for current file?
2008-06-11 3:17 ` Drew Adams
@ 2008-06-11 9:27 ` Juri Linkov
2008-06-11 13:46 ` Drew Adams
0 siblings, 1 reply; 16+ messages in thread
From: Juri Linkov @ 2008-06-11 9:27 UTC (permalink / raw)
To: Drew Adams; +Cc: Eli Zaretskii, emacs-devel
>> It is not very quick, since the code has to reread all Info subfiles
>> (its slowest part).
>
> That was my thinking - it really does seem to do quite a lot of work.
>
> On the other hand, at least with the manuals I use (Emacs and Elisp), it seems
> pretty snappy to me. Do you really see a performance problem, or is this just
> hypothetical?
If you have a fast machine, this doesn't mean everyone has the same.
Try on at least 300MHz proc to see how quick it is.
>> I see one problem: how to refresh the cached TOC buffer when
>> the Info file changes
>
> Do you mean when you go to a different manual (different file), or do you mean
> when someone changes the file on disk?
>
> I think we can ignore the latter (no?).
The same Info file doesn't change too often, but there are situations when
for instance, the user writes a new Info manual, and in the process of
writing uses the TOC as an overview of the manual (i.e. iterations like
add a new node, revisit the TOC, reorganize its structure, and so on).
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: Why doesn't Info `T' cache node tree for current file?
2008-06-11 9:27 ` Juri Linkov
@ 2008-06-11 13:46 ` Drew Adams
2008-06-11 19:02 ` Eli Zaretskii
0 siblings, 1 reply; 16+ messages in thread
From: Drew Adams @ 2008-06-11 13:46 UTC (permalink / raw)
To: 'Juri Linkov'; +Cc: 'Eli Zaretskii', emacs-devel
> >> It is not very quick, since the code has to reread all
> >> Info subfiles (its slowest part).
> >
> > That was my thinking - it really does seem to do quite a
> > lot of work.
> >
> > On the other hand, at least with the manuals I use (Emacs
> > and Elisp), it seems pretty snappy to me. Do you really see
> > a performance problem, or is this just hypothetical?
>
> If you have a fast machine, this doesn't mean everyone has the same.
> Try on at least 300MHz proc to see how quick it is.
I won't be trying a different machine, but perhaps someone else can.
Can you point to a particular manual for which this is unacceptably slow on a
slow machine? IOW, can you point to a concrete case that people with slow
machines can check?
> >> I see one problem: how to refresh the cached TOC buffer when
> >> the Info file changes
> >
> > Do you mean when you go to a different manual (different
> > file), or do you mean when someone changes the file on disk?
> >
> > I think we can ignore the latter (no?).
>
> The same Info file doesn't change too often, but there are
> situations when for instance, the user writes a new Info
> manual, and in the process of writing uses the TOC as an
> overview of the manual (i.e. iterations like
> add a new node, revisit the TOC, reorganize its structure, and so on).
Ah, I see - the use case is for Info manual writers.
That is important, but it is still a minority use case. Perhaps those people
could live with restarting Emacs. Or perhaps they could just delete the cache
manually so that it gets rebuilt. IOW, do you really think this is an important
enough use case to worry about?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Why doesn't Info `T' cache node tree for current file?
2008-06-11 13:46 ` Drew Adams
@ 2008-06-11 19:02 ` Eli Zaretskii
0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2008-06-11 19:02 UTC (permalink / raw)
To: Drew Adams; +Cc: juri, emacs-devel
> From: "Drew Adams" <drew.adams@oracle.com>
> Cc: "'Eli Zaretskii'" <eliz@gnu.org>, <emacs-devel@gnu.org>
> Date: Wed, 11 Jun 2008 06:46:39 -0700
>
> > The same Info file doesn't change too often, but there are
> > situations when for instance, the user writes a new Info
> > manual, and in the process of writing uses the TOC as an
> > overview of the manual (i.e. iterations like
> > add a new node, revisit the TOC, reorganize its structure, and so on).
>
> Ah, I see - the use case is for Info manual writers.
Not necessarily. The situation I bump into much more frequently is
when I update from CVS, then say "make info" with the Info manual
already loaded into one of my (many) Info buffers.
However, I don't think this is important enough to justify
over-optimization. `T' is already a rarely used command (I bet many
users don't even know it exists); adding an Info file that is modified
under our feet makes it _extremely_ rare.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Why doesn't Info `T' cache node tree for current file?
2008-06-11 0:02 ` Juri Linkov
` (2 preceding siblings ...)
2008-06-11 3:17 ` Drew Adams
@ 2008-06-11 3:20 ` Eli Zaretskii
2008-06-11 3:24 ` Drew Adams
3 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2008-06-11 3:20 UTC (permalink / raw)
To: Juri Linkov; +Cc: drew.adams, emacs-devel
> From: Juri Linkov <juri@jurta.org>
> Cc: "Eli Zaretskii" <eliz@gnu.org>, emacs-devel@gnu.org
> Date: Wed, 11 Jun 2008 03:02:15 +0300
>
> I see one problem: how to refresh the cached TOC buffer when the
> Info file changes
I can refresh it the first time the user invokes Info-toc and you
discover that the Info file is different from what it was last time
you created the TOC.
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: Why doesn't Info `T' cache node tree for current file?
2008-06-11 3:20 ` Eli Zaretskii
@ 2008-06-11 3:24 ` Drew Adams
0 siblings, 0 replies; 16+ messages in thread
From: Drew Adams @ 2008-06-11 3:24 UTC (permalink / raw)
To: 'Eli Zaretskii', 'Juri Linkov'; +Cc: emacs-devel
> > I see one problem: how to refresh the cached TOC buffer when the
> > Info file changes
>
> I can refresh it the first time the user invokes Info-toc and you
> discover that the Info file is different from what it was last time
> you created the TOC.
Yes, that's the way I see it. The file is associated with the TOC.
If, when the user hits `T', the current manual (file) is different from the one
associated with the cached TOC, then you build a new TOC.
The question is whether it's worth saving both caches. Memory/time trade-off.
^ permalink raw reply [flat|nested] 16+ messages in thread