Git development
 help / color / mirror / Atom feed
From: Jon Forrest <nobozo@gmail.com>
To: git@vger.kernel.org
Subject: OT - Idea for Speeding Up Building Git and Other Large C/C++ Packages
Date: Mon, 5 Oct 2026 09:36:20 -0700	[thread overview]
Message-ID: <11a0jm6$p29$1@ciao.gmane.io> (raw)

Git, and other large C/C++ packages, follows the convention of guarding
include files with, for example in http.h, a "#ifndef HTTP_H" directive.
This is nice because if http.h has already been included, its contents
won't be seen more than once by the compiler.

The trouble with this is that a substantial(?) amount of work
still has to get done in order for the preprocessor to see the
"#ifndef", such as opening the include file.

What if the preprocessor were changed so that doing "include http.h"
first checks if HTTP_H (or some agreed on symbol) is defined,
and then, if not, actually opens and processes http.h. This would
eliminate the overhead of needlessly opening include files.
This obviously wouldn't be a change to Git itself, which is why I
said it's OT, but Git would benefit from it.

Is this a good idea?

Cordially,
Jon Forrest
UC Berkeley (ret.)


                 reply	other threads:[~2026-10-05 16:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='11a0jm6$p29$1@ciao.gmane.io' \
    --to=nobozo@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