Subject: bug#5833: 23.1.94; Opening files on network shares on w32 is slow

From: Mathias Dahl <[email-masked]>
Date: Mon, 5 Apr 2010 23:03:55 +0200

> That's OK.  When we find the culprit, it should bring the time down to
> something significantly lower: no need for a stopwatch.

Instead of using my stop watch I wrote a small elisp program (slow.el)
to measure the time for me:

(defun measure ()
  (dotimes (i 10)
    (let ((time1 (float-time))
	  time2)
      (find-file "//corpnet/files/Archive/Archive75/docman/core/docman
5.11.0/docman/database/docman/index.cre")
      (setq time2 (float-time))
      (kill-buffer)
      (message "Time elapsed: %s" (- time2 time1)))))

(message "emacs -Q")
(measure)
(message "(setq vc-handled-backends nil)")
(setq vc-handled-backends nil)
(measure)
(message "(setq locate-dominating-stop-dir-regexp \"\")")
(setq locate-dominating-stop-dir-regexp "")
(measure)

I started Emacs with -Q -l slow.el

These are the results:

emacs -Q
Time elapsed: 7.5309998989105225
Time elapsed: 5.156000137329102
Time elapsed: 7.266000032424927
Time elapsed: 4.641000032424927
Time elapsed: 4.952999830245972
Time elapsed: 7.391000032424927
Time elapsed: 4.75
Time elapsed: 4.828000068664551
Time elapsed: 7.25
Time elapsed: 4.687000036239624
(setq vc-handled-backends nil)
Time elapsed: 2.7659997940063477
Time elapsed: 5.125
Time elapsed: 2.4690001010894775
Time elapsed: 2.4839999675750732
Time elapsed: 2.7350001335144043
Time elapsed: 4.7809998989105225
Time elapsed: 2.8589999675750732
Time elapsed: 2.5160000324249268
Time elapsed: 2.6089999675750732
Time elapsed: 5.266000032424927
(setq locate-dominating-stop-dir-regexp "")
Time elapsed: 2.187999963760376
Time elapsed: 1.937000036239624
Time elapsed: 1.9219999313354492
Time elapsed: 2.0160000324249268
Time elapsed: 4.5
Time elapsed: 1.9060001373291016
Time elapsed: 2.0159997940063477
Time elapsed: 2.078000068664551
Time elapsed: 1.9060001373291016
Time elapsed: 1.9059998989105225

The file to open is 801 bytes in size.

No result is as bad as when I do RET in Dired, but maybe that is
natural (maybe Emacs skips the redisplay). Right after the test above
I did that and got the times 5, 5, 3, 5, 5 and 5 seconds,
respectively. I again tested a few times with C-x C-f but there was no
difference.

The same test with another file in the same dir that has the size
113226 gives these results:

emacs -Q
Time elapsed: 7.578000068664551
Time elapsed: 5.141000032424927
Time elapsed: 5.014999866485596
Time elapsed: 7.391000032424927
Time elapsed: 4.812999963760376
Time elapsed: 5.062000036239624
Time elapsed: 7.812999963760376
Time elapsed: 4.733999967575073
Time elapsed: 7.375
Time elapsed: 5.937999963760376
(setq vc-handled-backends nil)
Time elapsed: 5.234000205993652
Time elapsed: 2.671999931335449
Time elapsed: 2.578000068664551
Time elapsed: 2.8439998626708984
Time elapsed: 5.046999931335449
Time elapsed: 2.7660000324249268
Time elapsed: 3.015000104904175
Time elapsed: 2.671999931335449
Time elapsed: 5.141000032424927
Time elapsed: 2.578000068664551
(setq locate-dominating-stop-dir-regexp "")
Time elapsed: 2.062999963760376
Time elapsed: 2.0149998664855957
Time elapsed: 2.2350001335144043
Time elapsed: 4.796999931335449
Time elapsed: 2.1089999675750732
Time elapsed: 2.125
Time elapsed: 2.0
Time elapsed: 2.0470001697540283
Time elapsed: 4.483999967575073
Time elapsed: 2.296999931335449

Slower but not in relation to the file size.

Anyway, maybe the numbers will say something to you.

/Mathias