Bug 48040

Summary: prepare-ChangeLog is slow when using git
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: New BugsAssignee: Adam Roben (:aroben) <aroben>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ddkilzer, eric, mrowe, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch none

Description Adam Roben (:aroben) 2010-10-20 22:25:52 PDT
prepare-ChangeLog is slow when using git
Comment 1 Adam Roben (:aroben) 2010-10-20 22:27:40 PDT
Created attachment 71389 [details]
Patch
Comment 2 David Kilzer (:ddkilzer) 2010-10-21 06:21:40 PDT
Comment on attachment 71389 [details]
Patch

This describes the difference in behavior from the git-diff(1) man page:

--find-copies-harder
    For performance reasons, by default, -C option finds copies only if the original file of the copy
    was modified in the same changeset. This flag makes the command inspect unmodified files as
    candidates for the source of copy. This is a very expensive operation for large projects, so use
    it with caution. Giving more than one -C option has the same effect.

-l<num>
    -M and -C options require O(n^2) processing time where n is the number of potential rename/copy
    targets. This option prevents rename/copy detection from running if the number of rename/copy
    targets exceeds the specified number.

Do you typically run prepare-ChangeLog with no arguments?  (I usually specify top-level directories, but maybe that's because I'm compensating for this behavior already.)

I guess it's okay to try this to see if it misjudges any files.  (If it does, that may be an early warning sign that "git svn dcommit" won't do an "svn copy" when it runs, which might be a good thing.)

BTW, the "-C -C -M" options were added by you in r24432/r24433 over 3 years ago.  :)
<http://trac.webkit.org/changeset/24432>
<http://trac.webkit.org/changeset/24433>

r=me
Comment 3 Adam Roben (:aroben) 2010-10-21 09:22:58 PDT
(In reply to comment #2)
> (From update of attachment 71389 [details])
> Do you typically run prepare-ChangeLog with no arguments?  (I usually specify top-level directories, but maybe that's because I'm compensating for this behavior already.)

I usually specify top-level directories, too. But even when doing that prepare-ChangeLog is pretty slow on Windows. This patch noticeably speeds it up.

> I guess it's okay to try this to see if it misjudges any files.  (If it does, that may be an early warning sign that "git svn dcommit" won't do an "svn copy" when it runs, which might be a good thing.)

I actually had one commit where this change made prepare-ChangeLog *better* at detecting moves. The patch renamed a lot of files from *Win.cpp to *.win.cpp. It's possible there will be cases where this makes things worse, though.

I noticed that resolve-ChangeLogs also passes -C -C -M. Maybe it should change, too?

Thanks for reviewing!
Comment 4 Adam Roben (:aroben) 2010-10-21 10:07:01 PDT
Committed r70246: <http://trac.webkit.org/changeset/70246>
Comment 5 Eric Seidel (no email) 2010-10-21 10:21:20 PDT
Nice.
Comment 6 Csaba Osztrogonác 2010-10-22 05:46:42 PDT
Comment on attachment 71389 [details]
Patch

remove r+, because it was landed
Comment 7 Adam Roben (:aroben) 2010-10-22 09:35:29 PDT
Committed r70246: <http://trac.webkit.org/changeset/70246>