unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Drew Adams <drew.adams@oracle.com>,
	emacs-devel@gnu.org
Subject: Re: auto-update of Info dir file?
Date: Tue, 16 May 2006 08:00:05 +0200	[thread overview]
Message-ID: <85bqtyzeze.fsf@lola.goethe.zz> (raw)
In-Reply-To: <buo64k661te.fsf@dhapc248.dev.necel.com> (Miles Bader's message of "Tue, 16 May 2006 13:17:17 +0900")

Miles Bader <miles.bader@necel.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> I think this will slow down Info startup to an intolerable degree.
>>> For example, I have more than 70 such top-level Info files in my Info
>>> directory, some of them compressed.
>>
>> It's probably OK if we only do the check when the mtime of the parent dir is
>> more recent than the mtime of the dir file (and only under Unix, of course,
>> since this presumes POSIXy semantics).
>
> I don't understand why Drew's suggestion would be slow anyway -- it's a
> simple syntactic check, which would only use the _names_ of the info
> files in the directory listing.  It wouldn't even have to stat the info
> files, much less read or decompress them.

Depends on how the stuff is done.  One can easily make an O(n^2) or
worse algorithm for this kind of thing.  Probably the fastest way
would be to stuff all menu entries and then files unsorted into one
list, sort that list (with `sort' which is stable), and then go
through it once, entering all files into the menu which are not
immediately preceded by a menu entry in the list.

This would probably be faster and use less memory than using a hash.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2006-05-16  6:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 15:28 auto-update of Info dir file? Drew Adams
2006-05-15 15:39 ` Andreas Schwab
2006-05-15 15:53   ` Drew Adams
2006-05-15 16:54     ` Andreas Schwab
2006-05-15 20:31 ` Eli Zaretskii
2006-05-16  3:54   ` Stefan Monnier
2006-05-16  4:17     ` Miles Bader
2006-05-16  6:00       ` David Kastrup [this message]
2006-05-16 17:39       ` Eli Zaretskii
2006-05-17  2:24         ` Miles Bader
2006-05-16 17:36     ` Eli Zaretskii
2006-05-16 17:54       ` Drew Adams
2006-05-16 18:14         ` Eli Zaretskii
2006-05-16 19:33           ` Drew Adams
2006-05-17  3:24             ` Eli Zaretskii
2006-05-16 19:44           ` Richard Stallman
2006-05-16 18:44       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85bqtyzeze.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).