Increase performance of git log on windows
See original GitHub issueCurrently 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:
- Created 7 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
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.
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.