Thoughts on file ids
John Arbash Meinel
john at arbash-meinel.com
Sun May 8 21:59:14 UTC 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 5/8/2011 1:56 PM, Jelmer Vernooij wrote:
> On Fri, 2011-05-06 at 16:06 +0200, John Arbash Meinel wrote:
>> On 05/06/2011 03:42 PM, Martin Pool wrote:
>>> Yeah, I was thinking of wt access possibly being simpler and faster by
>>> name, but you're right this will need testing and may well be a problem
>>> for committed trees.
>>>
>>
>> I think right now any api which is performance sensitive takes a "path"
>> hint. And I know we make use of it in many places. dirstate itself
>> prefers to lookup by path, because it stores things by path. If you pass
>> a file-id it reads all entries and creates a file_id => path mapping.
>>
>> We do this because WT level operations are, indeed, generally done by
>> path (status path, commit path, etc.) but repository level operations
>> are generally done by file-id (log over history of a file, diff, etc.)
> The one thing I've always wondered about this API is that while it
> allows you to pass in the path, it also requires you to have (possibly
> lookup) the file id. Is that never an issue in terms of performance?
>
> Cheers,
>
> Jelmer
>
I don't know about all of them. The underlying dirstate code would
rather you *didn't* pass a file_id, but will validate it if it is
passed. (It looks by path, and gives an exception if the file_id doesn't
match.)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk3HEjIACgkQJdeBCYSNAAMYPwCdHRL8Ak7OnerWdRRGOsixcBdF
HFMAn0Cw3Tc5UN3hgeJC/2PiwiIgD9B2
=wKvH
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list