question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Increase performance of git log on windows

See original GitHub issue

Currently we do this

git log --format="%n95E9659B-27DC-43C4-A717-D75969757EA5%nrefs=%ncommit=%H%ncommitAbbrev=%h%ntree=%T%ntreeAbbrev=%t%nparents=%P%nparentsAbbrev=%p%nauthor=%an <%ae> %at%ncommitter=%cn <%ce> %ct%nsubject=%nbody=%b%n%nnotes=%N%n95E9659B-27DC-43C4-A717-D75969757EA1%n" --date-order --decorate=full --skip=0 --max-count=500 --numstat --

and use nodejs spawn and stdout.on(‘data’ to read the result.

I ran some basic benchmarks and this takes 6 seconds on my install of windows 7 for around 100 commits at the command line. Obviously it takes a bit longer to parse these entries but in the main it is the stdout that is slow.

git on windows seems to be the worst performer. git on OSX has good performance. git on Fedora 25 good performance.

If you examine the result of the above command you will see we are preloading a lot of stuff we will never likely use.

We should load only what we need to display the git graph and then think about loading the other bits on demand async whatever to get a better UX.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mikes-ghcommented, Dec 14, 2016

Yes I saw that too probably stick to your current way. Native dependencies sounds like it might raise a few issues Since reading stdout from a spawn seems slower in windows I think the best we can do is only get what we need. For example we could cut the stream (and the size of the html) down dramatically if we only get what we need to display the git log page. If I limit the page size to 10 for example that makes a huge difference. I think were back to an on demand loading list spawning git on demand.

1reaction
mikes-ghcommented, Dec 14, 2016

We could look at the the performance of http://www.nodegit.org/ source https://github.com/nodegit/nodegit It uses libgit2 and lloks pretty active.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to improve git log performance? - Stack Overflow
Git 2.18 (Q2 2018) will improve git log performance: ... Teach Git to inspect a commit graph file to supply the contents of...
Read more >
Tips for improving git performance - Cognizant Softvision
You can improve git performance by doing the following: ... Truncate git history if commits earlier than a certain date are not needed, ......
Read more >
A Deep Dive into Git Performance using Trace2
Our team at Microsoft has been working to improve the performance of Git to scale up to extremely large repositories, such as the...
Read more >
git-log Documentation - Git
This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend...
Read more >
how to speed up "git log"? - git@vger.kernel.org
Are there some known tricks to speed up the operation of "git log"? On a file in a local copy of the coreutils...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found