From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#11757: 24.1.50; vc-git calls `process-file' too many times Date: Thu, 21 Jun 2012 06:12:58 +0400 Message-ID: <4FE2832A.1030308@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1340244831 23456 80.91.229.3 (21 Jun 2012 02:13:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Jun 2012 02:13:51 +0000 (UTC) To: 11757@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 21 04:13:39 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ShWtu-0005aX-N8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jun 2012 04:13:38 +0200 Original-Received: from localhost ([::1]:38097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShWtu-00009l-Ce for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jun 2012 22:13:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShWtq-000097-Ti for bug-gnu-emacs@gnu.org; Wed, 20 Jun 2012 22:13:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShWtp-0006RK-34 for bug-gnu-emacs@gnu.org; Wed, 20 Jun 2012 22:13:34 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShWto-0006RF-Rd for bug-gnu-emacs@gnu.org; Wed, 20 Jun 2012 22:13:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1ShWxC-0001Lj-Cy for bug-gnu-emacs@gnu.org; Wed, 20 Jun 2012 22:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Jun 2012 02:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13402450035158 (code B ref -1); Thu, 21 Jun 2012 02:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Jun 2012 02:16:43 +0000 Original-Received: from localhost ([127.0.0.1]:50397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ShWws-0001L8-SD for submit@debbugs.gnu.org; Wed, 20 Jun 2012 22:16:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36544) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ShWwn-0001Kx-AX for submit@debbugs.gnu.org; Wed, 20 Jun 2012 22:16:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShWtM-0006NM-Je for submit@debbugs.gnu.org; Wed, 20 Jun 2012 22:13:06 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:47654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShWtM-0006NC-BL for submit@debbugs.gnu.org; Wed, 20 Jun 2012 22:13:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShWtK-0008SJ-Gs for bug-gnu-emacs@gnu.org; Wed, 20 Jun 2012 22:13:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShWtI-0006Lk-G5 for bug-gnu-emacs@gnu.org; Wed, 20 Jun 2012 22:13:01 -0400 Original-Received: from forward20.mail.yandex.net ([95.108.253.145]:56859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShWtH-0006LM-TQ for bug-gnu-emacs@gnu.org; Wed, 20 Jun 2012 22:13:00 -0400 Original-Received: from smtp19.mail.yandex.net (smtp19.mail.yandex.net [95.108.252.19]) by forward20.mail.yandex.net (Yandex) with ESMTP id 553061042E6D for ; Thu, 21 Jun 2012 06:12:57 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1340244777; bh=K3U6fu1pBb3tjF6FBsPclEPACI2YRQNXvor/HvBu/cQ=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=DLjNZPYbF/6eUHyEi7Cjoua7Yfsw3WmAjflCteVv0d1OEaviFNKj5HdsB36K1hfJ0 u6H4ptjq/7sroWWf3yj11rCjZGAanU4zYNo9+8ATdCfos8P23AirX/7CJvXd454d1S RlxMJ06AeffUFDDY8wxVc7F5UHSZw1Be7CmOnrcA= Original-Received: from smtp19.mail.yandex.net (localhost [127.0.0.1]) by smtp19.mail.yandex.net (Yandex) with ESMTP id 42BF5BE0194 for ; Thu, 21 Jun 2012 06:12:57 +0400 (MSK) Original-Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp19.mail.yandex.net (nwsmtp/Yandex) with ESMTP id CuOGIn9Y-CuOSmOds; Thu, 21 Jun 2012 06:12:56 +0400 X-Yandex-Rcpt-Suid: bug-gnu-emacs@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1340244777; bh=K3U6fu1pBb3tjF6FBsPclEPACI2YRQNXvor/HvBu/cQ=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Content-Transfer-Encoding; b=bhYdivVrAnN0VlF+Ult4/BE9oh53Ff4qCAPowhq4wAxd7OpvPq6DbCPfCSmIhYiqm s4hTfmxC7viGgXZzBWq+kfc639SeboEI3qy/ewI6RBoLS5C0cMs1cbIJXfsJs2NsLj uQ65MqMS0NFAng7PdW3CqXeKDlt1Gf5r1NovKWH8= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61158 Archived-At: 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'