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

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

From
Sahitya Chandra <sahityajb@gmail.com>
Date
Jul 18, 2026, 08:05 UTC
Message-ID
<CAP=WS+tZuQyodN1_0Z4D7-uD9dpi9CKp8_sWvVTXqM6hWcwx6A@mail.gmail.com>
In-Reply-To
<20260718073135.GA22588@coredump.intra.peff.net>
On Sat, Jul 18, 2026 at 1:01 PM Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
> The patch looks good, and I think this explanation is OK-ish. But IMHO
> it is still worth talking about the quadratic issue, because that's
> really the motivation here (and what the "harder to reason about" is
> getting at).
>
> So maybe something like:
>
>   wt_status_collect_untracked() copies entries from dir.entries and
>   dir.ignored into string_lists using string_list_insert(). At first
>   glance this seems to be quadratic, because we may shift the backing
>   array, incurring O(n) work for each insert.
>
>   In practice, though, the entries in the dir struct are already sorted,
>   so each we never have to shift the array (and only pay the log-n
>   lookup cost for each insertion). But this is subtle and depends on the
>   behavior of fill_directory().
>
>   Collect the entries[...etc...]
>
> ?

Thanks, that wording makes sense. I will use that structure in v3, and submit it right away :)

Previous: Jeff KingNext: Sahitya Chandra
Message 8 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.