DescriptionMake lastchange.py faster using git cat-file.
lastchange.py is using git show -s to get the commit message of HEAD.
It turns out that on some older versions of git that is a rather
expensive operation. Under particular circumstances it can eventually
take several minutes (see crbug.com/431463 #27).
Anyways, git cat-file is x45 faster than the equivalent show command
for the sake of printing the commit message.
$ sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
$ time git show -s --format=%B HEAD > /dev/null
real 0m0.090s
$ sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
$ time git cat-file commit HEAD > /dev/null
real 0m0.002s
BUG=431463
Committed: https://crrev.com/5176f672c91c461a2f87f333e2b88ab407b2bc52
Cr-Commit-Position: refs/heads/master@{#304444}
Patch Set 1 #
Messages
Total messages: 8 (2 generated)
|