git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cache-tree: remove use of strbuf_addf in update_one

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2017, 18:51 UTC
Message-ID
<xmqqo9riugnh.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170810190349.jxlp6i7c6q5hpari@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 23 quoted lines
> On Thu, Aug 10, 2017 at 11:58:34AM -0700, Stefan Beller wrote:
>
>> On Thu, Aug 10, 2017 at 11:47 AM, Kevin Willford <kcwillford@gmail.com> wrote:
>> > String formatting can be a performance issue when there are
>> > hundreds of thousands of trees.
>> 
>> When changing this for the sake of performance, could you give
>> an example (which kind of repository you need for this to become
>> a bottleneck? I presume the large Windows repo? Or can I
>> reproduce it with a small repo such as linux.git or even git.git?)
>> and some numbers how this improves the performance?
>
> I was about to say the same thing. Normally I don't mind a small
> optimization without numbers if the result is obviously an improvement.
>
> But in this case the result is a lot less readable, and it's not
> entirely clear to me that it would always be an improvement (we now
> always run 3 strbuf calls instead of one, and have to check the length
> for each one).
>
> What I'm wondering specifically is if vsnprintf() on Kevin's platform
> (which I'll assume is Windows) is slow, and we would do better to
> replace it with a faster compat/ routine.
Yeah, I had the same reaction.
Previous: Stefan BellerNext: René Scharfe
Message 6 of 7 in “cache-tree: remove use of strbuf_addf in update_one”
  1. cache-tree: remove use of strbuf_addf in update_oneKevin Willford, Aug 10, 2017
  2. Stefan BellerAug 10, 2017
  3. Jeff KingAug 10, 2017
  4. Kevin WillfordAug 10, 2017
  5. Stefan BellerAug 10, 2017
  6. Junio C HamanoAug 14, 2017
  7. René ScharfeAug 11, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.