[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[TSVN] TMerge performance patch

From: Will Dean <svn_at_indcomp.co.uk>
Date: 2004-12-17 00:20:49 CET

Hi,

The attached patch addresses some severe performance problems with TMerge
on very large files.

The main problem was that someone had misguidedly set the growth behaviour
of the CStringArrays which hold the file to be a linear growth of 10 lines
at a time. This is really not suitable at all for a large file - an
exponential growth is much better. The default behaviour of CStringArray
(and the other MFC arrays, which all template off the same code) *is*
exponential growth, but it's strongly biased towards minimising memory
waste and away from minimising the number of allocations/copies.

So even though the CStringArray classes did better at their default
settings than with the 'grow-by-ten' setting, they still weren't very good.

To avoid all this lousy behaviour but not have to re-write vast scads of
TMerge, I have written a class template which makes a STL vector look like
an MFC array. I have replaced all the CStringArray and CDWORDArrays with
my class.

I have also stopped each file being loaded twice from disk rather than just
being copied in memory.

The upshot of all this is that I can diff two 160000-line files together
perfectly reasonably. The previous version took a lot longer to load.

The performance once the files are loaded/diff'd is excellent - I haven't
touched anything there.

Cheers,

Will

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org

Received on Fri Dec 17 00:22:49 2004

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.