all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: lee <lee@yun.yagibdah.de>
To: help-gnu-emacs@gnu.org
Subject: Re: iterating over a list while removing elements
Date: Thu, 20 Mar 2014 18:34:58 +0100	[thread overview]
Message-ID: <87lhw4vkn1.fsf@yun.yagibdah.de> (raw)
In-Reply-To: <slrnlijoej.9nq.joost.m.kremers@j.kremers4.news.arnhem.chello.nl> (Joost Kremers's message of "19 Mar 2014 18:28:35 GMT")

Joost Kremers <joost.m.kremers@gmail.com> writes:

> Note, BTW, that file-directory-p returns t for "." and "..". It seems to
> me that the only two names that directory-files could return that you
> really want to exclude are those two,[1] so there's no need for
> multisearch-directory-ref-p, I think. (Or is there?)

The idea is that (file-directory-p "..") may cause a file look-up which
can be avoided by string-matching.  String-matching is some magnitudes
faster than file look-ups.

When I try multisearch with with a source file from a somewhat large
application that has a bunch of #includes, it takes a couple (like 15 or
so) seconds to create the list of files, and it creates 123 additional
buffers.  When you look at the source of multisearch[1], you`ll see that
there can be a huge amount of look-ups, many of them on non-existing
files.

How does the disk cache deal with non-existing files?  The
meta-information is probably in the cache (more or less), yet there can
be no information for non-existing files.  Creating the list of files is
actually what takes most of the time.  Visiting them is really fast;
searching doesn`t take long, either.


[1]: https://github.com/lee-/emacs/tree/master/multisearch

> [1] Files can have dots in their names, so what do you want to do with a
> file whose name ends in a dot? Or two? Unlikely, for sure, but not
> impossible.

Hm.  I haven`t considered this possibility ...  I`ll have to change the
regexps used in `multisearch-directory-ref-p' ...

Hmmmm ... I`m testing this again, and there seems to be a bug
somewhere.  I`ll fix that tomorrow or so ...


-- 
Knowledge is volatile and fluid.  Software is power.



  reply	other threads:[~2014-03-20 17:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.17526.1395229207.10748.help-gnu-emacs@gnu.org>
2014-03-19 13:12 ` iterating over a list while removing elements Pascal J. Bourguignon
2014-03-19 18:28   ` Joost Kremers
2014-03-20 17:34     ` lee [this message]
2014-03-20 20:16       ` Eli Zaretskii
2014-03-21  5:25         ` lee
2014-03-20 16:33   ` lee
2014-03-19 11:39 lee
2014-03-19 12:39 ` Stefan
2014-03-20 16:02   ` lee
2014-03-19 13:11 ` Michael Albinus
2014-03-20 16:10   ` lee

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

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

  git send-email \
    --in-reply-to=87lhw4vkn1.fsf@yun.yagibdah.de \
    --to=lee@yun.yagibdah.de \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.