Git development
 help / color / mirror / Atom feed
* OT - Idea for Speeding Up Building Git and Other Large C/C++ Packages
@ 2026-10-05 16:36 Jon Forrest
  0 siblings, 0 replies; only message in thread
From: Jon Forrest @ 2026-10-05 16:36 UTC (permalink / raw)
  To: git

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.)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-05 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-05 16:36 OT - Idea for Speeding Up Building Git and Other Large C/C++ Packages Jon Forrest

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox