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

Re: 'setup_work_tree()' considered harmful

From
Mike Hommey <mh@glandium.org>
Date
Jun 18, 2008, 09:05 UTC
Message-ID
<20080618090527.GA24254@glandium.org>
In-Reply-To
<alpine.LFD.1.10.0806161723081.2949@woody.linux-foundation.org>
On Mon, Jun 16, 2008 at 05:45:25PM -0700, Linus Torvalds wrote:
Show 11 quoted lines
> ie note how it does one unnecessary "open()" less, but more importantly, 
> notice the difference between "/home/torvalds/kernel/.git/*" and ".git/*", 
> and realize that that second difference was the much more noticeable one.
> 
> And no, obviously the right fix is not to just comment out all of 
> "setup_work_tree()" (it will break stuff that depends on GIT_WORKTREE), 
> but I did that as a minimal example of showing what the bad effect of that 
> function is.
> 
> In general, I think we've gone in the wrong direction with a lot of the 
> "make_absolute_path" stuff. See above. 5% performance loss is not good.

Maybe using openat, fstatat, etc. when they are available, could be a good thing, already, though it wouldn't help for other platforms.

Mike
Previous: Johannes SchindelinNext: Linus Torvalds
Message 4 of 5 in “'setup_work_tree()' considered harmful”
  1. Linus TorvaldsJun 17, 2008
  2. Linus TorvaldsJun 17, 2008
  3. Johannes SchindelinJun 17, 2008
  4. Mike HommeyJun 18, 2008
  5. Linus TorvaldsJun 18, 2008

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.