Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] Optimize rename detection for a huge diff

From: David Kastrup <hidden>
Date: 2016-06-15 22:44:13

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] writes:

The first hunk is about shrinking the diff_score structure;
before the patch, it was O(NxM) where N and M are number of
rename source and destination candidates, but after the patch it
is now O(M), so this shrinkage should not matter, but score is
capped to MAX_SCORE (60000) and name_score is actually 0 or 1.
We cannot make it 1-bit unsigned bitfield as there is a qsort
comparison callback that does (b->name_score - a->name_score).
Hm?  Can't that be changed into

(b->name_score > a->name_score ? 1 
 : b->name_score < a->name_score ? -1 : 0)

or something?  Or perhaps just

  ((int)b->name_score - (int)a->name_score)

or so?

It sounds like a factor 2 is in question here, and that would seem like
an easy fix?

-- 
David Kastrup
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help