name-rev: improve memory usage
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest10 patches 15 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | name-rev: rewrite create_or_update_name()builtin/ | +12 | 4 replies | |
| 1/10 | name-rev: rewrite create_or_update_name()builtin/ | +12 | 0 replies | |
| 2/10 | name-rev: remove unused typedefbuiltin/ | +2 | 0 replies | |
| 3/10 | name-rev: respect const qualifierbuiltin/ | +3 | 0 replies | |
| 4/10 | name-rev: don't leak path copy in name_ref()builtin/ | +3 | 1 reply | |
| 5/10 | name-rev: don't _peek() in create_or_update_name()builtin/ | +4 | 0 replies | |
| 6/10 | name-rev: put struct rev_name into commit slabbuiltin/ | +11 | 0 replies | |
| 7/10 | name-rev: factor out get_parent_name()builtin/ | +14 | 0 replies | |
| 8/10 | name-rev: pre-size buffer in get_parent_name()builtin/ | +14 | 2 replies | |
| 9/10 | name-rev: generate name strings only if they are betterbuiltin/ | +18 | 2 replies | |
| 10/10 | name-rev: release unused name stringsbuiltin/ | +16 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/10] name-rev: improve memory usage
This series seeks to get reduce the size of memory allocations, the number of reallocations and the amount of leaks in git name-rev, to improve its performance. It starts with a few cleanups:
Martin Ågren (1):
name-rev: rewrite create_or_update_name()
René Scharfe (9):
name-rev: remove unused typedef
name-rev: respect const qualifier
name-rev: don't _peek() in create_or_update_name()
... then plugs a minor leak:
name-rev: don't leak path copy in name_ref()
... and gets rid of a level of indirection in commit slab usage:
name-rev: put struct rev_name into commit slab
The next two patches eliminate reallocations while building name strings for parent commits, which can make a surprisingly big difference in some cases:
name-rev: factor out get_parent_name()
name-rev: pre-size buffer in get_parent_name()
The next one avoids building names that are be discarded right away by checking first if they are better than a possibly present other name assigned earlier, which only provides a small speedup, but is the right thing to do:
name-rev: generate name strings only if they are better
And finally a tricky one whose commit message is a lot longer than its diff, which adds a bit of overhead and which probably needs the most reviewer attention to make sure it won't cause double frees:
name-rev: release unused name strings
builtin/name-rev.c | 133 ++++++++++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 57 deletions(-)
--
2.25.0