mbox series

[0/8,GSOC,RFC] ref-filter: code logic optimization

Message ID pull.1021.git.1629189701.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series ref-filter: code logic optimization | expand

Message

Philippe Blain via GitGitGadget Aug. 17, 2021, 8:41 a.m. UTC
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 code logic in ref-filter.

Changes in this patch series:

 1. Remove grab_oid to reduce unnecessary string comparison.
 2. Use atom_type in grab_person() and merge the two for loops.
 3. Remove strlen() and introducing xstrvfmt_len() and xstrfmt_len() to
    reduce strlen() overhead.
 4. Introduction ref_filter_slopbuf[1] to reduce memory allocation.
 5. Add deref to struct used_atom to increase the readability of the code.
 6. Introduction symref_atom_parser() to increase the readability of the
    code.
 7. Use switch/case instread of if/else to increase the readability of the
    code.

ZheNing Hu (8):
  [GSOC] ref-filter: remove grab_oid() function
  [GSOC] ref-filter: merge two for loop in grab_person
  [GSOC] ref-filter: remove strlen from find_subpos
  [GSOC] ref-filter: introducing xstrvfmt_len() and xstrfmt_len()
  [GSOC] ref-filter: introduction ref_filter_slopbuf[1]
  [GSOC] ref-filter: add deref member to struct used_atom
  [GSOC] ref-filter: introduce symref_atom_parser()
  [GSOC] ref-filter: use switch/case instead of if/else

 ref-filter.c | 432 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 237 insertions(+), 195 deletions(-)


base-commit: f000ecbed922c727382651490e75014f003c89ca
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1021%2Fadlternative%2Fref-filter-opt-code-logic-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1021/adlternative/ref-filter-opt-code-logic-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1021