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

[PATCH 0/5] [GSOC] [RFC] ref-filter: performance optimization

From
ZheNing Hu via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 17, 2021, 07:14 UTC
Message-ID
<pull.1020.git.1629184489.gitgitgadget@gmail.com>

Last time I submitted a very long patch series: https://lore.kernel.org/git/pull.1016.git.1628842990.gitgitgadget@gmail.com/ My mentor Christian suggested to split the performance optimization part out, so this patch series used to optimize performance optimization in ref-filter.

Changes in this patch series:
 1. Skip parse_object_buffer(), which can reduce object content parsing.
 2. Use linked list to record parsing results, which can reduce second
    format string parsing.
 3. Reuse final buffer, which can reduce memcpy();
 4. Add a need_get_object_info flag instead of compare two object_info,
    which can reduce memcmp();
 5. Use ALLOC_ARRAY() instead of CALLOC_ARRAY(), which can reduce memset();

Since the relevant part of git cat-file --batch has been deleted, the execution time of git for-each-ref is very short, I haven’t added performance tests yet for git for-each-ref.

ZheNing Hu (5):
  [GSOC] ref-filter: skip parse_object_buffer in some cases
  [GSOC] ref-filter: remove second parsing in format_ref_array_item
  [GSOC] ref-filter: reuse final buffer
  [GSOC] ref-filter: reduce unnecessary object_info comparisons
  [GSOC]: ref-filter: instead CALLOC_ARRAY to ALLOC_ARRAY
 builtin/branch.c       |   2 +
 builtin/for-each-ref.c |   3 +-
 builtin/tag.c          |   2 +
 builtin/verify-tag.c   |   2 +
 ref-filter.c           | 168 ++++++++++++++++++++++++++++++++---------
 ref-filter.h           |  17 ++++-
 6 files changed, 154 insertions(+), 40 deletions(-)
base-commit: f000ecbed922c727382651490e75014f003c89ca
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1020%2Fadlternative%2Fref-filter-opt-perf-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1020/adlternative/ref-filter-opt-perf-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1020
-- 
gitgitgadget
Next: ZheNing Hu via GitGitGadget
Message 1 of 6 in “[GSOC] [RFC] ref-filter: performance optimization”
  1. 0/5 [GSOC] [RFC] ref-filter: performance optimizationZheNing Hu via GitGitGadget, Aug 17, 2021
  2. 1/5 [GSOC] ref-filter: skip parse_object_buffer in some casesZheNing Hu via GitGitGadget, Aug 17, 2021
  3. 2/5 [GSOC] ref-filter: remove second parsing in format_ref_array_itemZheNing Hu via GitGitGadget, Aug 17, 2021
  4. 3/5 [GSOC] ref-filter: reuse final bufferZheNing Hu via GitGitGadget, Aug 17, 2021
  5. 4/5 [GSOC] ref-filter: reduce unnecessary object_info comparisonsZheNing Hu via GitGitGadget, Aug 17, 2021
  6. 5/5 [GSOC]: ref-filter: instead CALLOC_ARRAY to ALLOC_ARRAYZheNing Hu via GitGitGadget, Aug 17, 2021

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.