Skip to content

pr-962/newren/ort-perf-batch-12-v3

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

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

Submitted-As: https://lore.kernel.org/git/pull.962.v3.git.1622781578.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.962.git.1622104642.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.962.v2.git.1622559516.gitgitgadget@gmail.com
Assets 2