git status should be faster in Git 2.13 (Q2 2017), due to:
- optimization around string optimization array (see " ways to improve
git status performance ) - better read cache management.
At this last point, see commit a33fc72 (April 14, 2017) Jeff Hostetler ( jeffhostetler ) .
(merger of Junio ​​C Hamano - gitster - to commit to cdfe138 , April 24, 2017)
read-cache : force_verify_index_checksum
Teach Git to skip checking the SHA1-1 checksum at the end of the index file in verify_hdr() , which is called from read_index() if the global variable " force_verify_index_checksum " is not set.
Learn fsck to force this check.
Checksum checks are designed to detect disk damage, and for small projects, the time taken to calculate SHA-1 is not that important, but for giant repositories this calculation adds significant time to each team.
Git 2.14 again improves Git's performance by taking into account the “ non-screen cache ”, which allows Git to skip reading unprepared directories if their stat data has not changed using the mtime field of the mtime structure.
See Documentation/technical/index-format.txt .
See commit edf3b90 (May 08, 2017) by David Turner ( dturner-tw ) .
(the merger of Junior With Hamano - gitster - to commit fa0624f , May 30, 2017)
When git checkout , git merge , etc. manipulates the internal index, various pieces of information in the index extension are discarded from the initial state, since this is usually not the case, is constantly updated and synchronized with the operation on the main index.
The cache extension without a trace is now copied in these operations, which will speed up the "git status" (while the cache is not valid).
More generally, writing to the cache will also be faster with Git 2.14.x / 2.15
See commit ce012de , commit b50386c , commit 3921a0b (August 21, 2017) by Kevin Wilford (``) .
(Merger of Junio ​​With Hamano - gitster - at commit 030faf2 , August 27, 2017
Previously, we spent more than necessary on allocating and freeing cycles of a piece of memory when writing each index entry.
It has been optimized.
[That] will save somewhere between 3-7% when the index had more than a million records without sacrificing performance on small repositories.
December 2017 Update: Git 2.16 (Q1 2018) will offer an additional improvement, this time for git log , since the code to iterate over the lost object files has just received optimization.
See commit 163ee5e (December 04, 2017) by Derrick Stole ( derrickstolee ) .
(merger of Junio ​​C Hamano - gitster - on commit 97e1f85 , December 13, 2017
sha1_file : use strbuf_add() instead of strbuf_addf()
Replace using strbuf_addf() with strbuf_add() when listing free objects in for_each_file_in_obj_subdir() . Since we already check the length and hexadecimal values ​​of the string before using the path, we can prevent additional level calculations.
One consumer for_each_file_in_obj_subdir() is an abbreviation for the code. OID ( object identifiers ) abbreviations use a cached list of free objects (for a subdirectory of objects) to quickly execute repeated requests, but there is significant cache loading time when there are many free objects.
Most repositories do not have many unnecessary objects before repackaging, but in the case of GVFS (see " GVFS (Git Virtual File System) declaration ), repositories can grow to have millions of free objects.
Profiling 'git log' in Git For Windows in repo mode with GVFS support with ~ 2.5 million lost objects, 12% of the time was detected; CPU spent on strbuf_addf() .
Add a new performance test on p4211-line-log.sh , which is more sensitive to cache loading.
By limiting 1000 commits, we more accurately resemble the user waiting time when reading a history in a pager.
For a copy of the Linux repo with two packages ~ 512 MB in size and ~ 572K free objects, running git log -oneline -parents -raw -1000 'had the following performance:
HEAD~1 HEAD ---------------------------------------- 7.70(7.15+0.54) 7.44(7.09+0.29) -3.4%