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

[PATCH v4 0/4] Optimization batch 12: miscellaneous unthemed stuff

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 8, 2021, 16:11 UTC
Message-ID
<pull.962.v4.git.1623168703.gitgitgadget@gmail.com>
In-Reply-To
<pull.962.v3.git.1622781578.gitgitgadget@gmail.com>

This series depends on en/ort-perf-batch-11 textually, but is semantically independent of it.

Changes since v3:
 * Changed Acked-by from Stolee to Reviewed-by.
Changes since v2:
 * Made suggested minor tweaks from Stolee on Patch 1
 * Dropped patch 3, for now
 * Added Stolee's Acked-by
Changes since v1 (all for the first patch):
 * Add more comments explaining the sorting function, its purpose, and how
   its expected to be called
 * Small style fixup
 * Switch back to using string_list_sort() instead of direct QSORT()

This short series has a few optimizations, but only one of which affects the testcases of interest (namely, reducing our time spent on sorting an array). It also fixes a few comments.

For the testcases mentioned in commit 557ac0350d ("merge-ort: begin performance work; instrument with trace2_region_* calls", 2020-10-28), the changes in just this series improves the performance as follows:

                     Before Series           After Series
no-renames:        5.622 s ±  0.059 s     5.235 s ±  0.042 s
mega-renames:     10.127 s ±  0.073 s     9.419 s ±  0.107 s
just-one-mega:   500.3  ms ±  3.8  ms   480.1  ms ±  3.9  ms

As a reminder, before any merge-ort/diffcore-rename performance work, the performance results we started with were:

no-renames-am: 6.940 s ± 0.485 s no-renames: 18.912 s ± 0.174 s mega-renames: 5964.031 s ± 10.459 s just-one-mega: 149.583 s ± 0.751 s

Elijah Newren (4):
  merge-ort: replace string_list_df_name_compare with faster alternative
  diffcore-rename: avoid unnecessary strdup'ing in break_idx
  Fix various issues found in comments
  merge-ort: miscellaneous touch-ups
 diffcore-rename.c                   |  4 +-
 merge-ort.c                         | 80 ++++++++++++++++++++---------
 t/t6423-merge-rename-directories.sh |  2 +-
 3 files changed, 60 insertions(+), 26 deletions(-)
base-commit: 76e253793c9a1d7fdd1836d5e4db26dabd3d713a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-962%2Fnewren%2Fort-perf-batch-12-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-962/newren/ort-perf-batch-12-v4
Pull-Request: https://github.com/gitgitgadget/git/pull/962
Range-diff vs v3:
 1:  f63ffc2a7c22 ! 1:  140c1e89e0ec merge-ort: replace string_list_df_name_compare with faster alternative
     @@ Commit message
              just-one-mega:   500.3  ms ±  3.8  ms   480.1  ms ±  3.9  ms
      
          Signed-off-by: Elijah Newren <newren@gmail.com>
     -    Acked-by: Derrick Stolee <dstolee@microsoft.com>
     +    Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
      
       ## merge-ort.c ##
      @@ merge-ort.c: static int detect_and_process_renames(struct merge_options *opt,
 2:  cd13499a6ff5 ! 2:  be858c46cfe7 diffcore-rename: avoid unnecessary strdup'ing in break_idx
     @@ Commit message
          unrelated optimization noted in passing while looking at the code.
      
          Signed-off-by: Elijah Newren <newren@gmail.com>
     -    Acked-by: Derrick Stolee <dstolee@microsoft.com>
     +    Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
      
       ## diffcore-rename.c ##
      @@ diffcore-rename.c: static void register_rename_src(struct diff_filepair *p)
 3:  91c0962a7d75 ! 3:  55c0f2c4560a Fix various issues found in comments
     @@ Commit message
              function.  Update the comment now.
      
          Signed-off-by: Elijah Newren <newren@gmail.com>
     -    Acked-by: Derrick Stolee <dstolee@microsoft.com>
     +    Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
      
       ## diffcore-rename.c ##
      @@ diffcore-rename.c: void diffcore_rename_extended(struct diff_options *options,
 4:  01352fcdf3a9 ! 4:  6de569e6ac49 merge-ort: miscellaneous touch-ups
     @@ Commit message
          of pushing these changes upstream.
      
          Signed-off-by: Elijah Newren <newren@gmail.com>
     -    Acked-by: Derrick Stolee <dstolee@microsoft.com>
     +    Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
      
       ## merge-ort.c ##
      @@ merge-ort.c: static void add_pair(struct merge_options *opt,
-- 
gitgitgadget
Previous: Jeff KingNext: Elijah Newren via GitGitGadget
Message 35 of 39 in “Optimization batch 12: miscellaneous unthemed stuff”
  1. 0/5 Optimization batch 12: miscellaneous unthemed stuffElijah Newren via GitGitGadget, May 27, 2021
  2. 1/5 merge-ort: replace string_list_df_name_compare with faster alternativeElijah Newren via GitGitGadget, May 27, 2021
  3. René ScharfeMay 27, 2021
  4. Elijah NewrenMay 27, 2021
  5. René ScharfeMay 28, 2021
  6. Elijah NewrenMay 28, 2021
  7. Taylor BlauMay 28, 2021
  8. Elijah NewrenMay 28, 2021
  9. 2/5 diffcore-rename: avoid unnecessary strdup'ing in break_idxElijah Newren via GitGitGadget, May 27, 2021
  10. 3/5 diffcore-rename: enable limiting rename detection to relevant destinationsElijah Newren via GitGitGadget, May 27, 2021
  11. 4/5 Fix various issues found in commentsElijah Newren via GitGitGadget, May 27, 2021
  12. 5/5 merge-ort: miscellaneous touch-upsElijah Newren via GitGitGadget, May 27, 2021
  13. 0/5 Optimization batch 12: miscellaneous unthemed stuffElijah Newren via GitGitGadget, Jun 1, 2021
  14. 1/5 merge-ort: replace string_list_df_name_compare with faster alternativeElijah Newren via GitGitGadget, Jun 1, 2021
  15. Derrick StoleeJun 2, 2021
  16. 3/5 diffcore-rename: enable limiting rename detection to relevant destinationsElijah Newren via GitGitGadget, Jun 1, 2021
  17. Derrick StoleeJun 3, 2021
  18. Elijah NewrenJun 3, 2021
  19. 2/5 diffcore-rename: avoid unnecessary strdup'ing in break_idxElijah Newren via GitGitGadget, Jun 1, 2021
  20. 4/5 Fix various issues found in commentsElijah Newren via GitGitGadget, Jun 1, 2021
  21. 5/5 merge-ort: miscellaneous touch-upsElijah Newren via GitGitGadget, Jun 1, 2021
  22. Derrick StoleeJun 3, 2021
  23. 0/4 Optimization batch 12: miscellaneous unthemed stuffElijah Newren via GitGitGadget, Jun 4, 2021
  24. 1/4 merge-ort: replace string_list_df_name_compare with faster alternativeElijah Newren via GitGitGadget, Jun 4, 2021
  25. 3/4 Fix various issues found in commentsElijah Newren via GitGitGadget, Jun 4, 2021
  26. 4/4 merge-ort: miscellaneous touch-upsElijah Newren via GitGitGadget, Jun 4, 2021
  27. 2/4 diffcore-rename: avoid unnecessary strdup'ing in break_idxElijah Newren via GitGitGadget, Jun 4, 2021
  28. Derrick StoleeJun 4, 2021
  29. Elijah NewrenJun 4, 2021
  30. Elijah NewrenJun 4, 2021
  31. Jeff KingJun 4, 2021
  32. Derrick StoleeJun 4, 2021
  33. Elijah NewrenJun 4, 2021
  34. Jeff KingJun 4, 2021
  35. 0/4 Optimization batch 12: miscellaneous unthemed stuffElijah Newren via GitGitGadget, Jun 8, 2021
  36. 2/4 diffcore-rename: avoid unnecessary strdup'ing in break_idxElijah Newren via GitGitGadget, Jun 8, 2021
  37. 1/4 merge-ort: replace string_list_df_name_compare with faster alternativeElijah Newren via GitGitGadget, Jun 8, 2021
  38. 3/4 Fix various issues found in commentsElijah Newren via GitGitGadget, Jun 8, 2021
  39. 4/4 merge-ort: miscellaneous touch-upsElijah Newren via GitGitGadget, Jun 8, 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.