git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Cc: E R <pc88mxer@gmail.com>, git@vger.kernel.org
Subject: Re: integrating make and git
Date: Thu, 16 Apr 2009 04:26:15 -0400	[thread overview]
Message-ID: <20090416082615.GA27365@coredump.intra.peff.net> (raw)
In-Reply-To: <200904151930.32816.robin.rosenberg.lists@dewire.com>

On Wed, Apr 15, 2009 at 07:30:32PM +0200, Robin Rosenberg wrote:

> Take a look at ccache. It doesn't use Git, but it uses hashes of source, and
> compiler flags and associates that with the resulting object files, so it
> can avoid compiling. If you are building largs C/C++ (especially C++)
> projects you want it. 

In theory, one could improve something like ccache by asking git the
sha-1 of the file. Since git maintains a cache based on stat info, you
can get away with not looking at the file contents at all (which saves
CPU time in hashing, but also helps a lot when building from a cold
cache).

In practice, this doesn't help because:

  1. ccache looks at more than just the file itself. I believe it
     actually runs it through cpp and hashes that.

  2. People combine ccache with make; if the stat data hasn't changed,
     in most cases, you will skip building before you even get to
     ccache.

But one could probably design a system to replace both ccache and make
that relies on git's fast sha-1 reporting to avoid duplicate work. I
suspect nobody has bothered because make+ccache is "fast enough" that
the added complexity would not be worth it.

-Peff

  reply	other threads:[~2009-04-16  8:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15 15:19 integrating make and git E R
2009-04-15 15:41 ` Matthieu Moy
2009-04-15 16:20 ` Daniel Barkalow
2009-04-15 16:47   ` E R
2009-04-15 17:30     ` Robin Rosenberg
2009-04-16  8:26       ` Jeff King [this message]
2009-04-16  9:55         ` Matthieu Moy
2009-04-16 12:50           ` Nguyen Thai Ngoc Duy
2009-04-15 21:01     ` Daniel Barkalow
2009-04-15 21:34       ` John Bito
2009-04-16  3:50 ` Ben Jackson
2009-04-16  8:05   ` David Kågedal
2009-04-17 17:24     ` Dmitry Potapov
2009-04-18  7:03 ` Ealdwulf Wuffinga

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=20090416082615.GA27365@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=pc88mxer@gmail.com \
    --cc=robin.rosenberg.lists@dewire.com \
    /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).