From: Sahitya Chandra Date: Fri, 17 Jul 2026 14:37:31 GMT Subject: Re: [PATCH] wt-status: avoid quadratic insertion for untracked paths Message-ID: In-Reply-To: On Fri, Jul 17, 2026 at 11:57 AM Patrick Steinhardt 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.