emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: empty-directory predicate, native implementation


From: Arthur Miller
Subject: Re: empty-directory predicate, native implementation
Date: Sat, 17 Oct 2020 23:02:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> writes:

> Sorry I'm coming to this late.  It's a long thread,
> and I've only checked your patch, not the messages.
>
> I don't understand why we would do this.  Is the
> real aim to be able to have an empty-directory
> predicate, i.e., to be able to see if there are
> no files in a directory?
I would just like to add to the previous mail; that this optimisation
really does not matter on very first call.

Since read_files calls readdir, which reads in 32k batch (I think),
system will still fetch quite many inodes. The first call is probably
one that matters most for most application, or in most cases, in Emacs
for Dired's purposes, so there is not much savings to directly to SYS_getdents
directly so I agree with Eli that we don't need to go to Linux specific calls.

The most effect we get on subsequent calls comes probably from
Lisp itsel, by cutting of unnecessary lists traversals and list elements
creation as well as comparing entire directory contents with regex to
eliminate dots with such text. At least what I think currently, maybe I
am wrong about, I am not really expert in systems programming, so I am
not super on all the details.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]