From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: auto-update of Info dir file? Date: Tue, 16 May 2006 08:00:05 +0200 Message-ID: <85bqtyzeze.fsf@lola.goethe.zz> References: <87u07qr5iq.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1147763240 22689 80.91.229.2 (16 May 2006 07:07:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 May 2006 07:07:20 +0000 (UTC) Cc: Eli Zaretskii , Stefan Monnier , Drew Adams , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 16 09:07:15 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FfteE-0003uy-NQ for ged-emacs-devel@m.gmane.org; Tue, 16 May 2006 09:07:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FfteE-00072x-3S for ged-emacs-devel@m.gmane.org; Tue, 16 May 2006 03:07:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fftdx-00072g-Iu for emacs-devel@gnu.org; Tue, 16 May 2006 03:06:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fftdw-00072C-QO for emacs-devel@gnu.org; Tue, 16 May 2006 03:06:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fftdw-000726-L5 for emacs-devel@gnu.org; Tue, 16 May 2006 03:06:56 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FftgX-00087H-0j for emacs-devel@gnu.org; Tue, 16 May 2006 03:09:37 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Fftdv-0004l9-NM; Tue, 16 May 2006 03:06:55 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 4300C1C2E531; Tue, 16 May 2006 08:00:06 +0200 (CEST) Original-To: Miles Bader In-Reply-To: (Miles Bader's message of "Tue, 16 May 2006 13:17:17 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:54561 Archived-At: Miles Bader writes: > Stefan Monnier 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