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

Re: [RFC/PATCH] Documentation/technical/api-fswatch.txt: start with outline

From
Karsten Blees <karsten.blees@gmail.com>
Date
Mar 12, 2013, 23:21 UTC
Message-ID
<513FB85C.5010106@gmail.com>
In-Reply-To
<1362946623-23649-1-git-send-email-artagnon@gmail.com>
Am 10.03.2013 21:17, schrieb Ramkumar Ramachandra:
Show 17 quoted lines
> git operations are slow on repositories with lots of files, and lots
> of tiny filesystem calls like lstat(), getdents(), open() are
> reposible for this.  On the linux-2.6 repository, for instance, the
> numbers for "git status" look like this:
> 
>   top syscalls sorted     top syscalls sorted
>   by acc. time            by number
>   ----------------------------------------------
>   0.401906 40950 lstat    0.401906 40950 lstat
>   0.190484 5343 getdents  0.150055 5374 open
>   0.150055 5374 open      0.190484 5343 getdents
>   0.074843 2806 close     0.074843 2806 close
>   0.003216 157 read       0.003216 157 read
> 
> To solve this problem, we propose to build a daemon which will watch
> the filesystem using inotify and report batched up events over a UNIX
> socket.
[...]
Show 6 quoted lines
> +
> +The credential C API is meant to be called by Git code which needs
> +information aboutx filesystem changes.  It is centered around an
> +object representing the changes the filesystem since the last
> +invocation.
> +
Hmmm...I don't see how filesystem changes since last invocation can solve the problem, or am I missing something? I think what you mean to say is that the daemon should keep track of the filesystem *state* of the working copy, or alternatively the deltas/changes to some known state (such as .git/index)?
I'm also still skeptical whether a daemon will improve overall performance. In my understanding its essentially a filesystem cache in user-mode. The difference to using the OS filesystem cache directly (via lstat/readdir) is that we replace ~50k sys-calls with a single IPC call (i.e. the git <--> fswatch daemon communication is less 'chatty'). However, the 'chattyness' is still there between the fswatch daemon and the OS / inotify. Consider 'git status; make; make clean; git status'...that's a *lot* of changes to process for nothing (potentially slowing down make).
Then there's the issue of stale data in the cache. Modifying porcelain commands that use 'git status --porcelain' to compile their changesets will want 100% exact data. I'm not saying its not doable, but adding another platform specific, caching daemon to the tool chain doesn't exactly simplify things...
But perhaps I'm too pessimistic (or just stigmatized by inherently slow and out-of-date TGitCache/TSvnCache on Windows :-)
Previous: Jeff KingNext: Duy Nguyen
Message 6 of 17 in “Documentation/technical/api-fswatch.txt: start with outline”
  1. Documentation/technical/api-fswatch.txt: start with outlineRamkumar Ramachandra, Mar 10, 2013
  2. Heiko VoigtMar 11, 2013
  3. Ramkumar RamachandraMar 12, 2013
  4. Erik Faye-LundMar 12, 2013
  5. Jeff KingMar 12, 2013
  6. Karsten BleesMar 12, 2013
  7. Duy NguyenMar 13, 2013
  8. Karsten BleesMar 13, 2013
  9. Junio C HamanoMar 13, 2013
  10. Duy NguyenMar 14, 2013
  11. Pete WyckoffMar 15, 2013
  12. Thomas RastMar 16, 2013
  13. Ramkumar RamachandraMar 18, 2013
  14. Thomas RastMar 18, 2013
  15. Ramkumar RamachandraMar 25, 2013
  16. Duy NguyenMar 25, 2013
  17. Ramkumar RamachandraMar 25, 2013

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.