all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11757: 24.1.50; vc-git calls `process-file' too many times
@ 2012-06-21  2:12 Dmitry Gutov
       [not found] ` <handler.11757.B.13402450035158.ack@debbugs.gnu.org>
  2012-07-18 14:11 ` bug#11757: Fwd: " Michael Albinus
  0 siblings, 2 replies; 28+ messages in thread
From: Dmitry Gutov @ 2012-06-21  2:12 UTC (permalink / raw)
  To: 11757

When I open a file under Git version control, `vc-find-file-hook' takes
~1 second to run, even on small repositories, whereas for
Mercurial, for example, it's ~0.3 seconds.

There two two reasons for that:
1) Calling git is ~ twice as expensive as hg.
2) It's called more often.

All this under MS Windows.

Test setup:

(defadvice process-file (around time-it (program &optional infile buffer 
display &rest args) activate)
   (message "process-file %s %s" program args)
   (let ((beg (current-time)))
     (prog1 ad-do-it
       (message "%s elapsed"
                (/ (truncate (* (- (float-time (current-time))
                                   (float-time beg))
                                10000))
                   10000.0)))))

Results:

Open file from Git repo, make small modification, and save it:

   process-file git (ls-files -c -z -- INSTALL)
   0.2639 elapsed
   process-file git (symbolic-ref HEAD)
   0.1849 elapsed
   process-file git (ls-files -c -z -- INSTALL)
   0.1929 elapsed
   process-file git (diff-index -p --raw -z HEAD -- INSTALL)
   0.203 elapsed
   process-file git (rev-parse --verify HEAD)
   0.203 elapsed
   process-file git (symbolic-ref HEAD)
   0.186 elapsed
   Saving file c:/Users/gutov/vc/emacs-master/INSTALL...
   Wrote c:/Users/gutov/vc/emacs-master/INSTALL
   process-file git (ls-files -c -z -- INSTALL)
   0.217 elapsed
   process-file git (diff-index -p --raw -z HEAD -- INSTALL)
   0.233 elapsed
   process-file git (add --refresh -- INSTALL)
   0.2039 elapsed
   process-file git (symbolic-ref HEAD)
   0.21 elapsed

Note that "ls-files -c -z -- INSTALL" and "symbolic-ref HEAD" are both
called twice when the file is opened.

Do the same with Mercurial repo:

   process-file hg (--config alias.status=status --config 
defaults.status= status -A README.txt)
   0.1069 elapsed
   process-file hg (--config alias.status=status --config 
defaults.status= status -A README.txt)
   0.1099 elapsed
   process-file hg (log -l 1 --template {rev} README.txt)
   0.1019 elapsed
   Saving file c:/Users/gutov/vc/jqplot/README.txt...
   Wrote c:/Users/gutov/vc/jqplot/README.txt
   process-file hg (--config alias.status=status --config 
defaults.status= status -A README.txt)
   0.164 elapsed

Note lesser amount of calls (3 vs 6 for opening, 1 vs 4 for writing). Of
the 3, one also seems to be redundant.

In GNU Emacs 24.1.50.1 (i386-mingw-nt6.1.7601)
  of 2012-06-20 on SOL
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
  `configure --with-gcc (3.4) --cflags -IH:/Apps/System/gnuwin32/include'





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

end of thread, other threads:[~2012-07-18 17:01 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-21  2:12 bug#11757: 24.1.50; vc-git calls `process-file' too many times Dmitry Gutov
     [not found] ` <handler.11757.B.13402450035158.ack@debbugs.gnu.org>
2012-06-26 10:54   ` bug#11757: Acknowledgement (24.1.50; vc-git calls `process-file' too many times) Dmitry Gutov
2012-06-26 12:14     ` Michael Albinus
2012-06-28  0:51       ` Dmitry Gutov
2012-06-29 13:46         ` Michael Albinus
2012-06-29 16:06           ` Dmitry Gutov
2012-06-29 16:40             ` Michael Albinus
2012-06-29 17:03               ` Dmitry Gutov
2012-06-29 17:38                 ` Michael Albinus
2012-06-30  9:03                 ` Michael Albinus
2012-06-30 12:56                   ` Dmitry Gutov
2012-06-30 13:19                     ` Michael Albinus
2012-06-30 17:42                       ` Dmitry Gutov
2012-06-30 18:46                         ` Michael Albinus
2012-06-30 19:14                           ` Dmitry Gutov
2012-07-01  9:58                             ` Michael Albinus
2012-07-01 14:58                               ` Dmitry Gutov
     [not found]                               ` <4FF062D7.7050402@yandex.ru>
     [not found]                                 ` <878vf2sf7q.fsf@gmx.de>
2012-07-02 12:42                                   ` Dmitry Gutov
2012-07-02 12:44                                   ` Dmitry Gutov
2012-07-04 15:10                                     ` Michael Albinus
2012-07-04 16:42                                       ` Dmitry Gutov
2012-07-06 13:44                                         ` Michael Albinus
2012-07-06 15:55                                           ` Dmitry Gutov
     [not found]                                             ` <5000D21F.6080900@yandex.ru>
     [not found]                                               ` <87k3y36gbe.fsf@gmx.de>
     [not found]                                                 ` <50046AD3.1080605@yandex.ru>
     [not found]                                                   ` <87y5min9ad.fsf@gmx.de>
     [not found]                                                     ` <50063692.7080707@yandex.ru>
2012-07-18 14:38                                                       ` Michael Albinus
2012-07-18 17:01                                                         ` Dmitry Gutov
2012-06-30 23:01             ` Stefan Monnier
2012-06-30 23:38               ` Dmitry Gutov
2012-07-18 14:11 ` bug#11757: Fwd: " Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.