[MERGE] show_log with get_revisions

John Arbash Meinel john at arbash-meinel.com
Mon Jun 12 16:05:34 BST 2006


Robert Collins wrote:
> On Sun, 2006-06-11 at 22:50 -0400, Aaron Bentley wrote:
>> This produces a 13% speedup in my tests, and should also make further
>> optimization possible. 
> 
> I'll look at the rest of the patch shortly,  but I thought a quick
> subthread on 'can we have a benchmark for this please' would be good ;).
> 
> A 10K revision tree may be a little excessive at this stage for this -
> but certainly a 1K revision tree with only a few files - say 1 subdir,
> and a file and symlink each in the root and the subdir - would be great.
> 
> Rob
> 

Well, he has a 1k revision tree, which just has no changes throughout
the whole thing.
I think we could do a 1k tree with a few files, which changes each file
in turn. Something like:

self.build_tree([
	'0', '1', '2', '3', '4',
	'5', '6', '7', '8', '9',
	'sub/',
	'sub/10', 'sub/11', 'sub/12',
	'sub/13', 'sub/14', 'sub/15',
	'sub/16', 'sub/17', 'sub/18',
	'sub/19'
	])

for i in xrange(1000):
  fnum = i % 20
  if fnum >= 10:
    fname = 'sub/%s' % (fnum,)
  else:
    fname = str(fnum)
  f = open('sub/%s' % (fnum,), 'ab')
  f.write('added in %s\n' % (i,))
  f.close()
  tree.commit('Modified %s' % (fname,))


By changing the xrange() parameter, we can easily change the number of
revisions we create.

Another small possibility is to change the commit line to be:

tree.commit('Modified %s' % (fname,), specific_files=[fname])

When we finish cleaning things up, that should speed up the creation
time a lot, since it wouldn't have to check all the files. It also would
mean that we could make a much larger tree, without hurting performance
too much. And since 55% of kernel tree git commits only modify 1 file,
it is not a terrible first approximation.

Ultimately, I think it would be nice to have a fancier creation step,
something which could use mod to decide when to change more than 1 file.
(91% of all kernel git commits changed < 10 files, a very small percent
change hundreds, and a few change thousands of files).

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060612/d1580bbb/attachment.pgp 


More information about the bazaar mailing list