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

Re: [PATCH] branch as a builtin (again)

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 21, 2006, 21:25 UTC
Message-ID
<Pine.LNX.4.63.0608212323420.28360@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<59ad55d30608211337jabd515bra3566fbd0f7ba5a0@mail.gmail.com>
Hi,
On Mon, 21 Aug 2006, Kristian Høgsberg wrote:
Show 15 quoted lines
> On 8/21/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > Hi,
> > 
> > On Mon, 21 Aug 2006, Kristian Høgsberg wrote:
> > 
> > > Thanks to all who reviewed the patch, here's an updated version which
> > > should address all issues.
> > 
> > I would have preferred the use of path_list instead of rolling your own
> > thing with qsort(), but oh well.
> 
> Yeah, I saw that, but since I got flack for computing
> lookup_commit_reference(head_sha1) inside the delete_branches loop, I
> couldn't possibly risk the performance bottle neck of listing the
> branches using a O(n^2) insertion sort.

Insertion sort, as implemented in path_list, has an average O(n log(n)) runtime, and a worst-case O(n^2) runtime. Same as qsort...

Besides, it is not like we are dealing with millions of branches here. And using path_list _would_ make the code shorter.

Ciao, Dscho

Previous: Shawn Pearce
Message 13 of 13 in “branch as a builtin (again)”
  1. branch as a builtin (again)Kristian Høgsberg, Aug 20, 2006
  2. Johannes SchindelinAug 20, 2006
  3. David RientjesAug 21, 2006
  4. Shawn PearceAug 21, 2006
  5. Jonas FonsecaAug 21, 2006
  6. Kristian HøgsbergAug 21, 2006
  7. David RientjesAug 21, 2006
  8. Kristian HøgsbergAug 21, 2006
  9. Junio C HamanoAug 22, 2006
  10. Johannes SchindelinAug 21, 2006
  11. Kristian HøgsbergAug 21, 2006
  12. Shawn PearceAug 21, 2006
  13. Johannes SchindelinAug 21, 2006

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.