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

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

why is my cd command on eshell on Windows so slow?


From: Wayne Harris
Subject: why is my cd command on eshell on Windows so slow?
Date: Fri, 16 Apr 2021 15:40:29 -0300

This problem has to do either with eshell on GNU Emacs 27.1 or with
Windows and eshell on GNU Emacs 27.1.  I say this because I don't see
the same behavior with eshell on GNU Emacs 24.3.  (The cd command on
eshell on GNU Emacs 24.3 is pretty fast.)  But let's see what happens on
GNU Emacs 27.1.

Thinking it could somehow be the command itself, I uselessly created
this following alias:

%alias | grep 'cd time'
alias cd time cd $*
%

So when I cd into a directory, I get:

%cd dir/
0.001 secs
%

However, it actually took about 3 seconds for me to get my prompt back.
There is something before cd actually operates (or afterwards) that
makes me wait --- *sometimes*.  If I immediately ``cd ..'' and then cd
into dir/ once again, it's pretty fast.

%which cd
eshell/cd is a compiled Lisp function in `em-dirs.el'
%

Can you point me in the right direction?  This is a Windows system.

I would love to fix this delay.  It is not too infrequent and it is
correlated to directories infrequently acessed.  Thank you!

(*) One thing I tried

I tried

  (setq w32-get-true-file-attributes nil)

given its documentation (below), but I see no difference.  (Notice I
don't set this variable on my GNU Emacs 24.3 and I don't see any slow
down at all.)

--8<---------------cut here---------------start------------->8---
w32-get-true-file-attributes is a variable defined in ‘C source code’.
Its value is nil

Documentation:
Non-nil means determine accurate file attributes in ‘file-attributes’.
This option controls whether to issue additional system calls to determine
accurate link counts, file type, and ownership information.  It is more
useful for files on NTFS volumes, where hard links and file security are
supported, than on volumes of the FAT family.

Without these system calls, link count will always be reported as 1 and file
ownership will be attributed to the current user.
The default value ‘local’ means only issue these system calls for files
on local fixed drives.  A value of nil means never issue them.
Any other non-nil value means do this even on remote and removable drives
where the performance impact may be noticeable even on modern hardware.
--8<---------------cut here---------------end--------------->8---




reply via email to

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