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

OT - Idea for Speeding Up Building Git and Other Large C/C++ Packages

From
Jon Forrest <nobozo@gmail.com>
Date
Oct 5, 2026, 16:36 UTC
Message-ID
<11a0jm6$p29$1@ciao.gmane.io>

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

Message 1 of 1 in “OT - Idea for Speeding Up Building Git and Other Large C/C++ Packages”
  1. Jon ForrestOct 5, 2026

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.