unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How speedup find-dired?
@ 2011-01-17 21:59 Oleksandr Gavenko
  2011-01-17 22:57 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Oleksandr Gavenko @ 2011-01-17 21:59 UTC (permalink / raw)
  To: help-gnu-emacs

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!




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-18 17:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17 21:59 How speedup find-dired? Oleksandr Gavenko
2011-01-17 22:57 ` 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

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).