git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marco Costalba" <mcostalba@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Subject: Fast access git-rev-list output: some OS knowledge required
Date: Wed, 6 Dec 2006 20:24:42 +0100	[thread overview]
Message-ID: <e5bfff550612061124jcd0d94em47793710866776e7@mail.gmail.com> (raw)

I ask help to the list because my knowledge on this is not enough.

Currently qgit uses, socket based, QProcess class to read data from
'git rev-list'  when loading the repository at startup.

The time it takes to read, without processing, the whole Linux tree
with this approach it's almost _double_ of the time it takes 'git
rev-list' to write to a file:

$git rev-list --header --boundary --parents --topo-order HEAD >> tmp.txt

We are talking of about 7s against less then 4s, on my box (warm cache).

So I have a patch to make 'git rev-list' writing into a temporary file
and then read it in memory, perhaps it's not the cleaner way, but it's
faster, about 1s less.

I have browsed Qt sources and found that QProcess uses internal
buffers that are then copied again before to be used by the
application. File approach uses a call to read() /fread() buired
inside the Qt's QFile class, and no intermediate buffers, so perhaps
this could be the reason the second way it's faster.


Anyway there are some issues:

1) File tmp.txt is deleted as soon as read, but this is not enough
sometimes to avoid a costly and wasteful write access to disk by the
OS. What is the easiest, portable way to create a temporary 'in memory
only' file, with no disk access? Or at least delay the HD write access
enough to be able to read and delete the file before the fist block of
tmp.txt is flushed to disk?

2) There is a faster/cleaner (and *safe* ) way to access directly 'git
rev-list' output, something like (just as an example):

$git rev-list --header --boundary --parents --topo-order HEAD >> /dev/mem

Or something similar, possibly _simple_ and _portable_ , so to be able
to copy the big amount of 'git rev-list' output just once (about 30MB
with current tree).


3) Other suggestions?  ;-)


Thanks

             reply	other threads:[~2006-12-06 19:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06 19:24 Marco Costalba [this message]
2006-12-06 19:28 ` Fast access git-rev-list output: some OS knowledge required Shawn Pearce
2006-12-06 19:34   ` Marco Costalba
2006-12-06 19:42     ` Shawn Pearce
2006-12-06 19:51       ` Shawn Pearce
2006-12-06 20:08         ` Marco Costalba
2006-12-06 20:18           ` Shawn Pearce
2006-12-07 13:25         ` Andreas Ericsson
2006-12-07 14:53           ` Johannes Schindelin
2006-12-07 15:28             ` Andreas Ericsson
2006-12-07 16:01               ` Johannes Schindelin
2006-12-08 18:34           ` Marco Costalba
2006-12-08 20:10             ` Michael K. Edwards
2006-12-09 12:15               ` Marco Costalba
2006-12-06 23:27   ` Johannes Schindelin
2006-12-07  0:47     ` Linus Torvalds
2006-12-07  6:46       ` Marco Costalba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5bfff550612061124jcd0d94em47793710866776e7@mail.gmail.com \
    --to=mcostalba@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).