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

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

bug#52384: [External] : bug#52384: 26.3; dired buffer navigation tweak


From: Arthur Miller
Subject: bug#52384: [External] : bug#52384: 26.3; dired buffer navigation tweak
Date: Mon, 13 Dec 2021 17:21:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Cc: juri@linkov.net,  amperry@provide.net,  stefan@marxist.se,
>>   52384@debbugs.gnu.org
>> Date: Mon, 13 Dec 2021 11:14:27 +0100
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > No, ls-lisp.el is not used on any Posix hosts.
>> 
>> I thought so; would it be unrealistic to suggest that Emacs by default 
>> switches
>> to ls-lisp.el on all hosts?
>
> Yes.  ls-lisp doesn't support all of the switches that GNU ls
> supports.

Yes, I know it does not.. The idea is that it does not need to support
everything. By default it only uses -la flags anyway. Users who need extra
ffeatures of gnu ls, has to add extra switches themselves anyway. Also, gnu ls
is supported out of the box, probably only on gnu/Linux systems. Those users (me
included) could set ls-lisp-use-insert-directory-program to t, as MS users do
nowadays. As said, that would allow Emacs to count on uniform interface in Dired
by default at least, and could come with option to group directories by default.

>> I have done some measurements, not very scientific, just tested simply gnu 
>> ls vs
>> directory-files on my Arch Linux, with a directory ~5000 files. As I see it 
>> on
>> my computer, the most of time is spent on I/O, once the system has cached
>> inodes, it almost does not matter if I use ls binary or sl-lisp.el, or
>> directory-files directly:
>> 
>> *** Welcome to IELM ***  Type (describe-mode) for help.
>> ELISP> (benchmark-run 1 (find-file "/s/backup/unsorted"))
>> (0.202678959 0 0.0)
>> 
>> ELISP> (benchmark-run 1 (directory-files "/s/backup/unsorted"))
>> (0.003737047 0 0.0)
>> 
>> ELISP> (benchmark-run 1 (find-file "/s/backup/unsorted"))
>> (0.001892588 0 0.0)
>> 
>> ELISP> (benchmark-run 1 (find-file "/s/backup/unsorted"))
>> (0.001898974 0 0.0)
>> 
>> ls is faster of course, but not like a magnitude faster.
>
> I don't understand what you compared here.  Which results are wil ls
> and which with ls-lisp?  And why do you benchmark directory-files and
> nit insert-directory?

It was just a quick run to show that file listing is dominated by I/O
not so much by extra lisp work. First run is opening a directory which was not
opened in my system earlier, so OS has to catch it from the disk. First
find-file is with with gnu ls, other with ls-lisp.el. I threw in directory-files
since I think it is the lowest built-in to list files without additional work on
top of it. I was just after showing that performance is not suffering too much
if Emacs used ls-lisp.el by default.





reply via email to

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