bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#13539: Use fdopendir, fstatat and readlinkat, for efficiency.


From: Paul Eggert
Subject: bug#13539: Use fdopendir, fstatat and readlinkat, for efficiency.
Date: Mon, 28 Jan 2013 00:34:49 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

On 01/24/2013 09:28 AM, Eli Zaretskii wrote:

> Is it really worth our while to spend energy on speeding up an API
> that goes mostly unused in Emacs?  Its only heavy user is ls-lisp.el,

This patch also improves the performance of file-name-completion
-- perhaps you missed that part?  Anyway, on the POSIX side
it's a pretty simple patch to Emacs proper and is an obvious
performance win, and it'd be a shame if it couldn't be put in.

> I suggest to use in dired.c functions that will accept both a
> file name and a file descriptor,

Better than that, w32 can model the POSIX file descriptor by
using an int that represents the directory name.  The
attached patch does that.  It's a bit of a hack, but I don't
see why it wouldn't work.  If it doesn't work, we can fall
back on doing things the Gnulib way.  Gnulib uses 'int' to
emulate "open" directories on MS-Windows, and this works for
many other GNU applications.  It's probably cleaner to do it
that way in the long run, so this patch has a FIXME or two
about this.

In this patch, the MS-Windows port shouldn't need to worry
about the added source files; it should be able to ignore them all.
For example, it needn't worry about lib/dirent.in.h.

I haven't tested it on MS-Windows, though.

Attachment: fdopendis.txt
Description: Text document


reply via email to

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