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

Re: [PATCH] wt-status: avoid quadratic insertion for untracked paths

From
Sahitya Chandra <sahityajb@gmail.com>
Date
Jul 17, 2026, 14:37 UTC
Message-ID
<CAP=WS+tb-HnMmOjH7i+ZY0EBOT0xfDPi4wsTboiH0mRtCCs=ng@mail.gmail.com>
In-Reply-To
<alnLPSnOt_Sf7cA5@pks.im>
On Fri, Jul 17, 2026 at 11:57 AM Patrick Steinhardt <ps@pks.im> wrote:
> Out of curiosity: is this something that you have encountered in the
> real world as inefficient, or is this rather a theoretical inefficiency?
> If the former it would be great to add a small benchmark to the commit
> message.

Thanks for asking. I do not have a real-world benchmark for this. After Jeff's reply, I agree that the O(n^2) claim is too strong for the current code path because fill_directory() already returns the entries sorted, so string_list_insert() should usually append at the end.

I have reworded v2 to avoid that performance claim and describe the change as making the collection strategy explicit instead.

> Instead of sorting and then deduplicating you can call
> `string_list_sort_u()`. It does the exact same thing as you do here, but
> I guess it makes sense to use that interface anyway.
Done in v2. Thanks.
Previous: Sahitya ChandraNext: Sahitya Chandra
Message 5 of 10 in “wt-status: avoid quadratic insertion for untracked paths”
  1. wt-status: avoid quadratic insertion for untracked pathsSahitya Chandra, Jul 16, 2026
  2. Patrick SteinhardtJul 17, 2026
  3. Jeff KingJul 17, 2026
  4. Sahitya ChandraJul 17, 2026
  5. Sahitya ChandraJul 17, 2026
  6. wt-status: avoid repeated insertion for untracked pathsSahitya Chandra, Jul 17, 2026
  7. Jeff KingJul 18, 2026
  8. Sahitya ChandraJul 18, 2026
  9. wt-status: avoid repeated insertion for untracked pathsSahitya Chandra, Jul 18, 2026
  10. Jeff KingJul 18, 2026

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.