unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* why is my cd command on eshell on Windows so slow?
@ 2021-04-16 18:40 Wayne Harris via Users list for the GNU Emacs text editor
  2021-04-16 18:59 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Wayne Harris via Users list for the GNU Emacs text editor @ 2021-04-16 18:40 UTC (permalink / raw)
  To: help-gnu-emacs

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




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

end of thread, other threads:[~2021-04-17 15:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-16 18:40 why is my cd command on eshell on Windows so slow? Wayne Harris via Users list for the GNU Emacs text editor
2021-04-16 18:59 ` Eli Zaretskii
2021-04-16 20:14   ` Wayne Harris via Users list for the GNU Emacs text editor
2021-04-16 21:14     ` Stefan Monnier
2021-04-17  0:10       ` Wayne Harris via Users list for the GNU Emacs text editor
2021-04-17  8:28         ` Wayne Harris via Users list for the GNU Emacs text editor
2021-04-17 14:08           ` Stefan Monnier
2021-04-17 14:32             ` Óscar Fuentes
2021-04-17 14:39               ` Eli Zaretskii
2021-04-17 14:56                 ` Óscar Fuentes
2021-04-17 15:05                   ` Eli Zaretskii
2021-04-17 14:41               ` Stefan Monnier

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