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

Re: Fast access git-rev-list output: some OS knowledge required

From
Shawn Pearce <spearce@spearce.org>
Date
Dec 6, 2006, 20:18 UTC
Message-ID
<20061206201816.GF20320@spearce.org>
In-Reply-To
<e5bfff550612061208g6e4003e7ifa7dbd5ed69180c9@mail.gmail.com>
Marco Costalba <mcostalba@gmail.com> wrote:
Show 14 quoted lines
> On 12/6/06, Shawn Pearce <spearce@spearce.org> wrote:
> >Shawn Pearce <spearce@spearce.org> wrote:
> >
> >Perhaps there is some fast IPC API supported by Qt that you could
> >use to run the revision listing outside of the main UI process,
> >to eliminate the bottlenecks you are seeing and remove the problems
> >noted above?  One that doesn't involve reading from a pipe I mean...
> >
> 
> Qt it's very fast in reading from files, also git-rev-list is fast in
> write to a file...the problem is I would not want the file to be saved
> on disk, but stay cached in the OS memory for the few seconds needed
> to be written and read back, and then deleted. It's a kind of shared
> memory at the end. But I don't know how to realize it.

On a modern Linux (probably your largest target audience) a small file which has a very short lifespan (few seconds) is unlikey to hit the platter. Most filesystems will put the data into buffer cache and delay writing to disk because temporary files are so common on UNIX.

Though our resident Linux experts may chime in with more details...
 
> Also let git-rev-list to write directly in qgit process address space
> would be nice, indeed very nice.
And ugly.  :-)

SysV IPC (shared memory, semaphores) are messy and difficult to get right. mmap against a random file in the filesystem tends to work better on those systems which support it well, provided that the file isn't on a network mount. But again you still need semaphores or something like them to control access to the data in the mmap'd region.

I was thinking that maybe if Qt had a bounded buffer available for use between a process and its child, that you could use that to run your own "qgit-rev-list" child and get the data back more quickly, without the need for a temporary file. But it doesn't look like they have one. Oh well.

Your current temporary file approach is probably the best you can get, and has the simplest possible implementation. Doing better would require linking against libgit.a, and getting the core Git hackers to make at least the revision machinery more useful in a library setting.

Previous: Marco CostalbaNext: Andreas Ericsson
Message 7 of 17 in “Fast access git-rev-list output: some OS knowledge required”
  1. Marco CostalbaDec 6, 2006
  2. Shawn PearceDec 6, 2006
  3. Marco CostalbaDec 6, 2006
  4. Shawn PearceDec 6, 2006
  5. Shawn PearceDec 6, 2006
  6. Marco CostalbaDec 6, 2006
  7. Shawn PearceDec 6, 2006
  8. Andreas EricssonDec 7, 2006
  9. Johannes SchindelinDec 7, 2006
  10. Andreas EricssonDec 7, 2006
  11. Johannes SchindelinDec 7, 2006
  12. Marco CostalbaDec 8, 2006
  13. Michael K. EdwardsDec 8, 2006
  14. Marco CostalbaDec 9, 2006
  15. Johannes SchindelinDec 6, 2006
  16. Linus TorvaldsDec 7, 2006
  17. Marco CostalbaDec 7, 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.