{"thread":{"id":"64085","subject":"Performance (self-compiled vs. distributed)","startedAt":"2025-09-03T20:31:58Z","lastAt":"2025-09-04T21:59:29Z","messageCount":3,"participants":["D. Ben Knoble","Ben Knoble"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"525459","messageId":"CALnO6CA3FkiOeF4w1TUf9S_UDTG_1iRxjEZcAkfrL_eqY+P26w@mail.gmail.com","threadId":"64085","inReplyTo":null,"subject":"Performance (self-compiled vs. distributed)","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-09-03T20:31:44Z","receivedAt":"2025-09-03T20:31:58Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"I have an installation of Git at /usr/local/bin/git managed by\nHomebrew. I'm also tinkering with building my own Git (+ patches) to\nexperiment with new features. Today I used \"make install …\" to get\nthat in ~/bin/git, but I'm noticing some performance problems. My\nshell prompt started coming back slower, especially in a large\nmonorepo.\n\nFor example, inside said monorepo (apologies in advance; output is on\na computer I can't easily copy from):\n\n    hyperfine -Ni -w10 {/usr/local,$HOME}/bin/git\n    …\n    /usr/local/bin/git ran 4.99 +/- 1.69 times faster than ~/bin/git\n\nThe difference is 22ms +/- 6.5ms (15.3ms–56.3ms) compared to 109.7ms\n+/- 17.8ms (91.1ms–159.9ms).\n\nMy build recipe was\n\n    export DEVELOPER=1\n    export XML_CATALOG_FILES=/usr/local/etc/xml/catalog\n    make -j \"$(nproc)\" all doc\n    make install install-doc install-html\n\nWhich differs somewhat from Homebrew's recipe (namely, Perl & Python\npath aren't set; nor is USE_LIBPCRE nor INSTALL_SYMLINKS… I'm ignoring\nthe \"extras\" for now). I wouldn't particularly expect any of those to\ncreate an issue, though.\n\nAny tips on debugging this would be greatly appreciated.\n\nSome other tidbits:\n\n    ls -lh@ {/usr/local,$HOME}/bin/git\n    -rwxr-xr-x@ … 4.4M … ~/bin/git\n        com.apple.provenance     11B\n    -r-xr-xr-x@ … 3.5M … /usr/local/bin/git\n        com.apple.provenance     11B\n\nI wondered if quarantining was at play, and this seems to indicate it\nisn't. It is interesting that my binary is so much bigger!\n\nSource I compiled: https://github.com/benknoble/git/tree/ps-jj\n\nPS I also noticed we put all the RelNotes in\n$prefix/share/doc/git-doc/RelNotes/*.adoc; I might have expected those\nto get turned into HTML, too?\n\n-- \nD. Ben Knoble\n"},{"id":"525515","messageId":"CALnO6CCEF75uriogAEd5LfORJ-m9OmDcF7ubu-U_xLWwxfZWTQ@mail.gmail.com","threadId":"64085","inReplyTo":"CALnO6CA3FkiOeF4w1TUf9S_UDTG_1iRxjEZcAkfrL_eqY+P26w@mail.gmail.com","subject":"Re: Performance (self-compiled vs. distributed)","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-09-04T14:05:48Z","receivedAt":"2025-09-04T14:06:02Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Wed, Sep 3, 2025 at 4:31 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:\n>\n> I have an installation of Git at /usr/local/bin/git managed by\n> Homebrew. I'm also tinkering with building my own Git (+ patches) to\n> experiment with new features. Today I used \"make install …\" to get\n> that in ~/bin/git, but I'm noticing some performance problems. My\n> shell prompt started coming back slower, especially in a large\n> monorepo.\n>\n> For example, inside said monorepo (apologies in advance; output is on\n> a computer I can't easily copy from):\n>\n>     hyperfine -Ni -w10 {/usr/local,$HOME}/bin/git\n>     …\n>     /usr/local/bin/git ran 4.99 +/- 1.69 times faster than ~/bin/git\n>\n> The difference is 22ms +/- 6.5ms (15.3ms–56.3ms) compared to 109.7ms\n> +/- 17.8ms (91.1ms–159.9ms).\n>\n> My build recipe was\n>\n>     export DEVELOPER=1\n>     export XML_CATALOG_FILES=/usr/local/etc/xml/catalog\n>     make -j \"$(nproc)\" all doc\n>     make install install-doc install-html\n\nInteresting. It was suggested off-list that I should try building with\nCFLAGS=-Oz, which I'm having some trouble propagating (with V=1, I see\nsome initial files built with -Oz and then later some with -O2??).\n\nBut on my other (non-corporate-managed) machine, I see almost no\ntiming difference between a built Git and a Homebrew-installed Git. So\nI wonder if the corporate binary sniffer is causing problems…\n\n-- \nD. Ben Knoble\n"},{"id":"525565","messageId":"E66D04C7-BAA7-48EA-997C-2E399CEE769F@gmail.com","threadId":"64085","inReplyTo":"CALnO6CCEF75uriogAEd5LfORJ-m9OmDcF7ubu-U_xLWwxfZWTQ@mail.gmail.com","subject":"Re: Performance (self-compiled vs. distributed)","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-09-04T21:59:17Z","receivedAt":"2025-09-04T21:59:29Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 4 sept. 2025 à 10:05, D. Ben Knoble <ben.knoble@gmail.com> a écrit :\n> \n> ﻿On Wed, Sep 3, 2025 at 4:31 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:\n>> \n>> I have an installation of Git at /usr/local/bin/git managed by\n>> Homebrew. I'm also tinkering with building my own Git (+ patches) to\n>> experiment with new features. Today I used \"make install …\" to get\n>> that in ~/bin/git, but I'm noticing some performance problems. My\n>> shell prompt started coming back slower, especially in a large\n>> monorepo.\n>> \n>> For example, inside said monorepo (apologies in advance; output is on\n>> a computer I can't easily copy from):\n>> \n>>    hyperfine -Ni -w10 {/usr/local,$HOME}/bin/git\n>>    …\n>>    /usr/local/bin/git ran 4.99 +/- 1.69 times faster than ~/bin/git\n>> \n>> The difference is 22ms +/- 6.5ms (15.3ms–56.3ms) compared to 109.7ms\n>> +/- 17.8ms (91.1ms–159.9ms).\n>> \n>> My build recipe was\n>> \n>>    export DEVELOPER=1\n>>    export XML_CATALOG_FILES=/usr/local/etc/xml/catalog\n>>    make -j \"$(nproc)\" all doc\n>>    make install install-doc install-html\n> \n> Interesting. It was suggested off-list that I should try building with\n> CFLAGS=-Oz, which I'm having some trouble propagating (with V=1, I see\n> some initial files built with -Oz and then later some with -O2??)\n\nFixed this, which helped with the binary size…\n\n\n> But on my other (non-corporate-managed) machine, I see almost no\n> timing difference between a built Git and a Homebrew-installed Git. So\n> I wonder if the corporate binary sniffer is causing problems…\n\n…but not speed. Sigh. Assuming I can rule in or out the corporate parts, I’ll keep troubleshooting. Might try to install to the Homebrew paths just to see what happens. (I’m assuming the sniffer uses a fingerprint though and not just the path.)"}]}