emacs-devel
[Top][All Lists]
Advanced

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

RE: Why doesn't Info `T' cache node tree for current file?


From: Drew Adams
Subject: RE: Why doesn't Info `T' cache node tree for current file?
Date: Tue, 10 Jun 2008 13:57:18 -0700

> > > AFAIK, Info doesn't maintain the node structure (it 
> > > doesn't need to be a tree, btw, it could be a graph)
> > > in memory at all.  It doesn't need to, except for
> > > Info-toc.  So if you are suggesting that the results of
> > > Info-toc should be stashed away waiting for the user to invoke
> > > Info-toc again for the same Info file, then maybe we should do it;
> > 
> > Yes, that's what I was thinking of.
> > But I was just wondering why it isn't done.
> 
> Simple: because it isn't needed.  All Info needs to move from a node
> is 3 pointers (next, prev, and up), and these are written on the
> header line of each node.  So there's no need to build any structure
> in memory at all, the information is always at Info's fingertips.

Wondering why it isn't done... for the same reason you agreed "maybe we should
do it": to save rebuilding (efficiency).

I know it's not needed for node navigation.

And, as I said, I can see that it is not in fact needed for efficiency - which
was a bit surprising to me.

> > Actually, `T' seems to create the TOC buffer quite quickly.
> > I'm a bit surprised, when I look at the code. It seems like it would
> > not be so quick.
> 
> It gets help from the detailed node listing in the Top node.

Yes, I saw that. It's still a bit surprising.

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 was after sending that thought that I experimented some
more and saw that building the tree is quicker than I expected - and quick
enough.






reply via email to

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