[MERGE] updated benchmark caching

John Arbash Meinel john at arbash-meinel.com
Tue Aug 15 04:54:57 BST 2006


Martin Pool wrote:
> +1 with comments, as long as (as it seems?) caching is off by default.

It wasn't, but in this latest update it is.

...

> 
> It seems like a lot of stuff is being put into this class that doesn't
> strongly belong there.  Perhaps we can have a separate class for setting
> up the test trees?  I'd prefer that were separated out before this
> lands.
> 

Honestly the only thing that Benchmark has is the helper functions for
creating trees.
However, to make that file much cleaner, I've gone ahead and created
bzrlib/benchmarks/tree_creator/*
files
Which contains a TreeCreator class, which encapsulates the basic caching
logic, and a simple interface for creating new trees.

And then I simplified Benchmark so it just contains helper functions
that create and use the right TreeCreator.

...

> 
> Just a comment: you could also write this as a base class where
> particular methods are overridden to specialize handling of particular
> files.  I'm not sure doing so would be really much better, but it's
> arguably consistent with the generally OO (rather than functional) style
> we use.
> 
> For example in test_copy_tree_handlers it could accumulate into the
> copier object.
> 

Well, there is a tradeoff between functionality by inheritance and
functionality by association. I'm using a function that takes a
customized data structure. You could arguably do it as 2 classes that
work with each other (one iterates over the tree, the other does the work).

If you feel strongly, I can update it.


I'm hoping this is reasonable. I think it leaves things reasonably
clean. And makes it pretty clear where the work should be done to add
new stuff.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: benchmark-caching.diff
Type: text/x-patch
Size: 41188 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060814/0d26d511/attachment.bin 
-------------- 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/20060814/0d26d511/attachment.pgp 


More information about the bazaar mailing list