On Tue, Aug 17, 2010 at 3:26 PM, Johan Corveleyn <jcor...@gmail.com> wrote: > Another thing that occurred to me: since most time of the current > blame implementation is spent on "diff" (svn_diff_file_diff_2), maybe > a quick win could be to simply (?) optimize the diff code? Or write a > specialized faster version for blame. > > On my tests with a 1,5 Mb file (61000 lines), svn diffing it takes > about 500 ms on my machine. GNU diff is much faster (300 ms for the > first run, 72 ms on following runs). This seems to indicate that there > is much room for optimization of svn diff. Or is there something extra > that svn diff does, necessary in the svn context? > > I have looked a little bit at the svn diff code, and saw that most of > the time is spent in the while loop inside svn_diff__get_tokens in > token.c, presumably extracting the tokens (lines) from the file(s). > Haven't looked any further/deeper. Anybody have any brilliant > ideas/suggestions? Or is this a bad idea, not worthy of further > exploration :-) ?
As noted in http://svn.haxx.se/dev/archive-2010-08/0517.shtml, my performance measurements of svn diff were quite inaccurate, to say the least. After eliminating antivirus, and running with a release build instead of a debug build, svn diff is just about on par with GNU diff. So this eliminates the option of optimizing diff ... Cheers, -- Johan