[MERGE] Use a LRUCache in LocalTransport.clone

John Arbash Meinel john at arbash-meinel.com
Tue Jan 15 04:43:12 GMT 2008


Andrew Bennetts wrote:
> John Arbash Meinel wrote:
> [...]
>> If you still have the call log around, can you at least track down where 
>> clone() is happening under get_weave_or_empty()? I couldn't find it at a 
>> quick glance.
> 
> It appears that I still do.
> 
> It seems to be in pack_repo's get_weave_or_empty, if I'm reading this callgrind
> right...
> 
> I've attached the callgrind file.
> 
> -Andrew.
> 
> 

Looking closely at the function, we have:

         return knit.KnitVersionedFile('text:' + file_id,
             self.transport.clone('..'),
             None,
             index=knit_index,
 
access_method=self.repo._pack_collection.text_index.knit_access,
             factory=knit.KnitPlainFactory())


However, the Transport being passed in is (I believe) not even being 
used, because it is really "access_method" that defines how it will read 
data.
I *think* it is being cloned because at that level "tranpsort" is 
pointing at the ".bzr/repository/packs" subdirectory, but we want to 
report errors to users at the ".bzr/repository" level. We could 
trivially have it do it another way if this is a performance issue.

John
=:->




More information about the bazaar mailing list