[merge] bzr uses permissions of containing directory
John Arbash Meinel
john at arbash-meinel.com
Fri Dec 16 20:53:05 GMT 2005
Michael Ellerman wrote:
> On Fri, 16 Dec 2005 07:48, John Arbash Meinel wrote:
>
>>Michael Ellerman wrote:
>>
>>>On Thu, 15 Dec 2005 16:05, John Arbash Meinel wrote:
>>>
>>>>After much gnashing of teeth, I have updated the Transport interface,
>>>>Branch itself, such that it know checks to see what the mode of '.bzr'
>>>>is, and then uses that to determine the permissions for all files
>>>>underneath.
>>>>You can see my changes here:
>>>>http://bzr.arbash-meinel.com/branches/bzr/permissions/
>
>
>>>Worst case it's 27% slower, best case it's only 5%. Not sure what
>>>accounts for the 18:00 time?
>>
>>Did you run the permissions branch before? I'm just wondering if it had
>>to compile all of the python files, which would add a lot of overhead.
>
>
> Duuuuh, I'm such a dolt. So ignore the 18:00 time, that's the initial compile.
>
>
>>Thanks for the numbers. Can you try it with _set_file_mode = False.
>>I'm guessing that would bring the load back a lot.
>
>
> This is with _set_file_mode = False.
>
> $ time ../bzr/permissions/bzr branch kexec kexec-branch
> 225.11user 30.72system 14:23.51elapsed 29%CPU
>
> $ time bzr branch kexec kexec-branch
> 247.37user 32.87system 15:07.96elapsed 30%CPU
>
> $ time ../bzr/permissions/bzr branch kexec kexec-branch
> 210.96user 29.44system 14:55.94elapsed 26%CPU
>
> $ time bzr branch kexec kexec-branch
> 239.31user 31.67system 15:26.55elapsed 29%CPU
>
> Weird.
>
> cheers
>
Actually, in my tests, I saw cases where 'bzr.permissions' was actually
faster than bzr.dev. I really don't know why. Especially because I just
merged up-to-date against bzr.dev.
The only thing I can really think of is this code in atomicfile.py:
try:
- stat = os.lstat(self.realfilename)
- os.chmod(self.tmpfilename, stat.st_mode)
+ if self._new_mode is None:
+ self._new_mode = os.lstat(self.realfilename).st_mode
except OSError, e:
if e.errno != errno.ENOENT:
raise
+ else:
+ os.chmod(self.tmpfilename, self._new_mode)
+
So because I am setting the mode explicitly, it doesn't have the extra
os.lstat() function call. It does the same chmod (AtomicFile was
chmodding already).
But if you have _set_file_mode = False, then it should still be doing
that lstat(). So I really don't know what is going on. It might have
something similar going on for directories.
But at least we can say that it isn't really slower on the local
filesystem. :)
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051216/813c9543/attachment.pgp
More information about the bazaar
mailing list