Re: What's cooking in git.git (Jul 2018, #03; Wed, 25)
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Aug 2, 2018, 12:41 UTC
- Message-ID
- <CAP8UFD0yWYvrbgtKjUs8oVks36Rp4qpfGAj3tambixSeC+-_1w@mail.gmail.com>
- In-Reply-To
- <xmqqpnzaq6jf.fsf@gitster-ct.c.googlers.com>
On Thu, Jul 26, 2018 at 6:57 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> Оля Тележная <olyatelezhnaya@gmail.com> writes: > >> 2018-07-26 1:13 GMT+03:00 Junio C Hamano <gitster@pobox.com>: >>> >>> * ot/ref-filter-object-info (2018-07-17) 5 commits >>> - ref-filter: use oid_object_info() to get object >>> - ref-filter: merge get_obj and get_object >>> - ref-filter: initialize eaten variable >>> - ref-filter: fill empty fields with empty values >>> - ref-filter: add info_source to valid_atom >>> >>> A few atoms like %(objecttype) and %(objectsize) in the format >>> specifier of "for-each-ref --format=<format>" can be filled without >>> getting the full contents of the object, but just with the object >>> header. These cases have been optimzied by calling >>> oid_object_info() API. >>> >>> What's the doneness of this one? >> >> It is ready. Thanks. > > Thanks, the question was meant more to the reviewers and mentors > than the original author, though ;-)
I just tested this patch series on git.git on my laptop with the following:
$ time git for-each-ref --format='%(objecttype)' >/dev/null
and the best I can get without it is:
real 0m0,038s user 0m0,034s sys 0m0,004s
while with it I can get:
real 0m0,017s user 0m0,016s sys 0m0,000s
The results are similar with --format='%(objectsize)'.
So I think it is a nice improvement.
Looking at the code of the patches again, I can't see any simple way to improve on the way it is done.
Thanks, Christian.