all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: How speedup find-dired?
Date: Mon, 17 Jan 2011 23:59:31 +0200	[thread overview]
Message-ID: <ih2e46$f5$1@dough.gmane.org> (raw)

I use Cygwin/Windows combination.

Default value of 'find-ls-option' is:

   ("-ls" . "-gilsb")

or which in my case:

   ("-exec ls -ld {} \\;" . "-ld")

Invoking ls for every file is too slow (~= 3 file per sec).

I try set

   (setq find-ls-option '("-print" . ""))

but resulted M-x find-dired buffer does not properly parsed by
'find-dired-filter', which uses 'dired-insert-set-properties'
which depend on 'directory-listing-before-filename-regexp'.

So I try different strings to start match this regex, this one match:

   (string-match directory-listing-before-filename-regexp "-rw-rw-rw- 1 
2010-08-10 23:01 fractal-generator.h")

So I set

(setq find-ls-option '("-printf '-rw-rw-rw- %s %AY-%Am-%Ad %AH:%AM 
%p\n'" . ""))

And all work fine and fast. Further I replace %s with constant 0, to
make less attribute reading operation.

Also I think that replacing file access time with constant also make
running faster.

find with -ls option also work, but output contain many garbage data.

My questions why maintain permission/data/size if I only search for
file names?

How make this search platform independent and independent on installed
utils and their versions?

I previously post how make dired platform/utils independent,
based only on Emacs capabilities:

;;; ----------------------------------------------------------------
;;; ls-lisp, dired ls.

;; If non-nil - use 'insert-directory-program', which I dislike.
(setq ls-lisp-use-insert-directory-program nil)
(setq ls-lisp-ignore-case t)
(setq ls-lisp-dirs-first t)
(if (memq system-type '(windows-nt cygwin))
     (setq ls-lisp-verbosity nil)
   (setq  ls-lisp-verbosity '(links uid gid)))
;; Force use 'ls-lisp-format-time-list'.
(setq ls-lisp-use-localized-time-format t)
(setq ls-lisp-format-time-list
       '("%Y-%m-%d %H:%M:%S"
         "%Y-%m-%d %H:%M   "))
(require 'ls-lisp)

Help me with doing this for find-dired!

Also how about platform/utils independent grep-find/rgrep/lgrep?

-- 
Best regards!




             reply	other threads:[~2011-01-17 21:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17 21:59 Oleksandr Gavenko [this message]
2011-01-17 22:57 ` How speedup find-dired? Eli Zaretskii
2011-01-18 10:08   ` Oleksandr Gavenko
2011-01-18 15:17     ` Eli Zaretskii
2011-01-18 15:35       ` Oleksandr Gavenko
2011-01-18 15:57       ` Drew Adams
2011-01-18 16:32         ` Le Wang
2011-01-18 17:05           ` Drew Adams

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='ih2e46$f5$1@dough.gmane.org' \
    --to=gavenkoa@gmail.com \
    --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.