git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pratyush Yadav <me@yadavpratyush.com>
To: Mark Levedahl <mlevedahl@gmail.com>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	git <git@vger.kernel.org>,
	Christian Couder <christian.couder@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] git-gui: Perform rescan on window focus-in
Date: Mon, 29 Jul 2019 13:45:44 +0530	[thread overview]
Message-ID: <005d7946-3fbf-9c06-21fb-51f10d06f33e@yadavpratyush.com> (raw)
In-Reply-To: <724fb243-c660-ae04-1b2f-caf34794b799@gmail.com>

On 29/07/19 7:58 AM, Mark Levedahl wrote:
> On 7/28/19 6:49 PM, brian m. carlson wrote:> On 2019-07-28 at 22:10:29, 
> Pratyush Yadav wrote:
>  >> The function is not documented, and I only started spelunking the 
> code a
>  >> couple days back, so I'll try to answer with what I know. It might 
> not be
>  >> the full picture.
>  >>
>  >> Running git-gui --trace, these commands are executed during a rescan:
>  >>
>  >> /usr/lib/git-core/git-rev-parse --verify HEAD
>  >> /usr/lib/git-core/git-update-index -q --unmerged --ignore-missing 
> --refresh
>  >>
>  >
>  > Great. This sounds like a well-reasoned change. I'll let other folks who
>  > use git-gui more chime in to see what they think as well.
>  >
> 
> I'm assuming this does what is currently done by F5.
> A simple rescan from git-gui in the git repository takes about 8 seconds 
> on my corporate laptop running Windows, making this happen on change of 
> window focus is definitely not a friendly change from my view point.
> 

This is a Windows problem maybe? On my Linux machine with an almost dead 
hard drive, it takes under 10ms to do a refresh on the git repository 
(which has about 56,000 commits).

Can you check what takes so long? I don't use Windows or I'd do this myself.

Go to git-gui.sh and add some prints to the rescan procedure (line 1450) 
to trace which operation takes time. It is not a shell script, but a tcl 
script, so you'd need to add "puts <your_string_here>" just to have an 
approximate idea of what takes so long.

Can someone else who uses git-gui comment on the time taken to rescan on 
the git repo (on Windows, Linux, or Mac)?

You can use this to see how long it takes to do a rescan. It will print 
the time taken to stdout:

-- >8 --
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 8ca2033dc8..7f2962f060 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2360,7 +2360,11 @@ proc do_rescan {} {
  }

  proc ui_do_rescan {} {
+	set t [clock milliseconds]
  	rescan {force_first_diff ui_ready}
+	set t2 [clock milliseconds]
+
+	puts "Time elapsed in ui_do_rescan = [expr $t2 - $t]ms"
  }

  proc do_commit {} {
-- >8 --

-- 
Regards,
Pratyush Yadav

  reply	other threads:[~2019-07-29  8:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-28 15:17 [PATCH] git-gui: Perform rescan on window focus-in Pratyush Yadav
2019-07-28 21:36 ` brian m. carlson
2019-07-28 22:10   ` Pratyush Yadav
2019-07-28 22:32     ` Pratyush Yadav
2019-07-28 22:49     ` brian m. carlson
2019-07-29  2:24       ` Mark Levedahl
2019-07-29  2:26       ` Mark Levedahl
2019-07-29  2:28       ` Mark Levedahl
2019-07-29  8:15         ` Pratyush Yadav [this message]
2019-07-31 19:42           ` Johannes Schindelin
2019-08-01 21:52             ` Pratyush Yadav
2019-08-02 12:39               ` Johannes Schindelin
2019-08-02 20:00                 ` Pratyush Yadav
2019-08-03 20:34                   ` Johannes Schindelin
2019-08-04 12:53                     ` Pratyush Yadav
2019-08-04 19:10                       ` Johannes Schindelin
2019-08-04 20:17                         ` Pratyush Yadav
2019-08-02 16:47               ` Junio C Hamano
2019-08-02 20:13                 ` Pratyush Yadav
2019-08-04 18:56                   ` Johannes Schindelin
2019-07-29  5:09       ` Junio C Hamano
2019-07-29  8:44         ` Pratyush Yadav
2019-07-28 21:44 ` Pratyush Yadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=005d7946-3fbf-9c06-21fb-51f10d06f33e@yadavpratyush.com \
    --to=me@yadavpratyush.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mlevedahl@gmail.com \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).