Re: [PATCH 3/3] commit-graph: stop using full rev_info for diffs
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Dec 27, 2019, 14:53 UTC
- Message-ID
- <061c6800-1516-ddd9-968d-a1274e93d6a1@gmail.com>
- In-Reply-To
- <20191222093222.GC3460818@coredump.intra.peff.net>
On 12/22/2019 4:32 AM, Jeff King wrote:
Show 9 quoted lines
> When we perform a diff to get the set of changed paths for a commit, > we initialize a full "struct rev_info" with setup_revisions(). But the > only part of it we use is the diff_options struct. Besides being overly > complex, this also leaks memory, as we use the fake argv to > setup_revisions() create a pending array which is never cleared. > > Let's just use diff_options directly. This reduces the peak heap usage > of "git commit-graph write --changed-paths" on linux.git from ~4GB to > ~1.2GB.
In my testing, this went from ~6gb to ~4gb.
I'm guessing that my memory difference is related to how poorly my packs are repacked/redeltified.
Thanks, -Stolee