git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git slow unless piped to cat

From
PZPhilipp Zabel <p.zabel@pengutronix.de>
Date
Aug 27, 2019, 09:12 UTC
Message-ID
<1566897126.4102.5.camel@pengutronix.de>
In-Reply-To
<20190827085637.g6cpnuofpteyfqfz@pengutronix.de>
On Tue, 2019-08-27 at 10:56 +0200, Uwe Kleine-König wrote:
Show 49 quoted lines
> On Tue, Aug 27, 2019 at 10:41:11AM +0200, SZEDER Gábor wrote:
> > On Tue, Aug 27, 2019 at 10:15:59AM +0200, Uwe Kleine-König wrote:
> > > I have a problem here with git being slow in some situations.
> > > Using git 2.23.0 (from Debian) the effect is:
> > > 
> > > ukl@dude.ptx:/ptx/src/git/linux.git$ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"; time git show v5.2
> > > tag v5.2
> > > ...
> > > 
> > > real	0m12.727s
> > > user	0m0.300s
> > > sys	0m0.371s
> > > 
> > > But to get the actual data isn't the problem:
> > > 
> > > ukl@dude.ptx:/ptx/src/git/linux.git$ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"; time git show v5.2 | cat
> > > tag v5.2
> > > ...
> > > 
> > > real	0m0.764s
> > > user	0m0.014s
> > > sys	0m0.020s
> > > 
> > 
> > How does 'git --no-pager show v5.2' perform?  If it's as fast as the
> > case piping the output to cat, then look into what pager and pager
> > options you use.
> 
> 	ukl@dude.ptx:/ptx/src/git/linux.git$ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"; time git --no-pager show v5.2
> 	tag v5.2
> 	...
> 
> 	real	0m13.225s
> 	user	0m0.355s
> 	sys	0m0.336s
> 
> So this doesn't seem to be the problem. Also the local configuration
> can be ruled out:
> 
> 	ukl@dude.ptx:/ptx/src/git/linux.git$ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"; time env GIT_CONFIG_NOSYSTEM=1 HOME=/nonexistant XDG_CONFIG_HOME=/nonexistant git --no-pager show --no-color v5.2
> 	tag v5.2
> 	...
> 
> 	real	0m13.587s
> 	user	0m0.335s
> 	sys	0m0.336s
> 
> Thanks
> Uwe

Have you checked strace output? I see a directory walk through .git/refs and .git/packed-refs if the output is not redirected.

regards Philipp

Previous: Uwe Kleine-KönigNext: SZEDER Gábor
Message 4 of 13 in “git slow unless piped to cat”
  1. Uwe Kleine-KönigAug 27, 2019
  2. SZEDER GáborAug 27, 2019
  3. Uwe Kleine-KönigAug 27, 2019
  4. Philipp ZabelAug 27, 2019
  5. SZEDER GáborAug 27, 2019
  6. Uwe Kleine-KönigAug 27, 2019
  7. SZEDER GáborAug 27, 2019
  8. Uwe Kleine-KönigAug 27, 2019
  9. Michal SuchánekAug 27, 2019
  10. Jeff KingAug 27, 2019
  11. Uwe Kleine-KönigAug 27, 2019
  12. Bryan TurnerAug 27, 2019
  13. Uwe Kleine-KönigAug 28, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.