diff options
| author | René Scharfe <l.s.r@web.de> | 2020-02-04 22:22:36 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-02-05 10:24:15 -0800 |
| commit | f13ca7cef51cc709c645f9da97f09a150bdb2cac (patch) | |
| tree | 663eb5711a834524d422cceee285d9afca1795e9 /commit.c | |
| parent | name-rev: don't _peek() in create_or_update_name() (diff) | |
| download | git-f13ca7cef51cc709c645f9da97f09a150bdb2cac.tar.gz git-f13ca7cef51cc709c645f9da97f09a150bdb2cac.zip | |
name-rev: put struct rev_name into commit slab
The commit slab commit_rev_name contains a pointer to a struct rev_name,
and the actual struct is allocated separatly. Avoid that allocation and
pointer indirection by storing the full struct in the commit slab. Use
the tip_name member pointer to determine if the returned struct is
initialized.
Performance in the Linux repository measured with hyperfine before:
Benchmark #1: ./git -C ../linux/ name-rev --all
Time (mean ± σ): 953.5 ms ± 6.3 ms [User: 901.2 ms, System: 52.1 ms]
Range (min … max): 945.2 ms … 968.5 ms 10 runs
... and with this patch:
Benchmark #1: ./git -C ../linux/ name-rev --all
Time (mean ± σ): 851.0 ms ± 3.1 ms [User: 807.4 ms, System: 43.6 ms]
Range (min … max): 846.7 ms … 857.0 ms 10 runs
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions
