Patchwork [8,of,9,v3] auditvfs: forward options property from nested vfs

login
register
mail settings
Submitter Augie Fackler
Date Aug. 5, 2016, 9:45 p.m.
Message ID <7ec7023b4cb4acaeb42b.1470433509@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/16140/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 5, 2016, 9:45 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1470410362 14400
#      Fri Aug 05 11:19:22 2016 -0400
# Node ID 7ec7023b4cb4acaeb42b4fa4ed28b82ebed41b71
# Parent  d8942cf57007c0d18dd0400c3c0ee881c3ca2a31
auditvfs: forward options property from nested vfs

This was breaking my ability to use treemanifests in bundlerepos, and
was deeply mysterious. We should probably just make the options
property a formal part of the vfs API, and make it a required
construction parameter. Sadly, I don't have time to dive into that
refactor right now.
stefanrin@gmail.com - Nov. 17, 2016, 12:32 p.m.
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1470410362 14400
> #      Fri Aug 05 11:19:22 2016 -0400
> # Node ID 7ec7023b4cb4acaeb42b4fa4ed28b82ebed41b71
> # Parent  d8942cf57007c0d18dd0400c3c0ee881c3ca2a31
> auditvfs: forward options property from nested vfs
> 
> This was breaking my ability to use treemanifests in bundlerepos, and
> was deeply mysterious. We should probably just make the options
> property a formal part of the vfs API, and make it a required
> construction parameter. Sadly, I don't have time to dive into that
> refactor right now.
> 
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -638,6 +638,14 @@ class auditvfs(object):
>      def mustaudit(self, onoff):
>          self.vfs.mustaudit = onoff
>  
> +    @property
> +    def options(self):
> +        return self.vfs.options
> +
> +    @options.setter
> +    def options(self, value):
> +        self.vfs.options = value
> +
>  class filtervfs(abstractvfs, auditvfs):
>      '''Wrapper vfs for filtering filenames with a function.'''
>  

Are you aware that this very changeset makes a dramatic performance difference
when cloning from a HG20 bundle with generaldelta? Our product repository is
around 100MB when bundled, and a clone from this bundle would take 30min on my
machine. Tested with hg rev 43924f3a55fa, which is the immediate predecessor.
However, with this patch applied (i.e., rev 69109052d9ac), the time needed for
the operation drops to 1min, which is something I can live with ;).

added 53460 changesets with 98526 changes to 14774 files (+6 heads)
real    0m56.661s
user    0m54.604s
Augie Fackler - Nov. 17, 2016, 1:38 p.m.
> On Nov 17, 2016, at 7:32 AM, stefanrin@gmail.com wrote:
> 
>> # HG changeset patch
>> # User Augie Fackler <augie at google.com>
>> # Date 1470410362 14400
>> #      Fri Aug 05 11:19:22 2016 -0400
>> # Node ID 7ec7023b4cb4acaeb42b4fa4ed28b82ebed41b71
>> # Parent  d8942cf57007c0d18dd0400c3c0ee881c3ca2a31
>> auditvfs: forward options property from nested vfs
>> 
>> This was breaking my ability to use treemanifests in bundlerepos, and
>> was deeply mysterious. We should probably just make the options
>> property a formal part of the vfs API, and make it a required
>> construction parameter. Sadly, I don't have time to dive into that
>> refactor right now.
>> 
>> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
>> --- a/mercurial/scmutil.py
>> +++ b/mercurial/scmutil.py
>> @@ -638,6 +638,14 @@ class auditvfs(object):
>>     def mustaudit(self, onoff):
>>         self.vfs.mustaudit = onoff
>> 
>> +    @property
>> +    def options(self):
>> +        return self.vfs.options
>> +
>> +    @options.setter
>> +    def options(self, value):
>> +        self.vfs.options = value
>> +
>> class filtervfs(abstractvfs, auditvfs):
>>     '''Wrapper vfs for filtering filenames with a function.'''
>> 
> 
> Are you aware that this very changeset makes a dramatic performance difference
> when cloning from a HG20 bundle with generaldelta? Our product repository is
> around 100MB when bundled, and a clone from this bundle would take 30min on my
> machine. Tested with hg rev 43924f3a55fa, which is the immediate predecessor.
> However, with this patch applied (i.e., rev 69109052d9ac), the time needed for
> the operation drops to 1min, which is something I can live with ;).
> 
> added 53460 changesets with 98526 changes to 14774 files (+6 heads)
> real    0m56.661s
> user    0m54.604s

I had no idea, but I’ll certainly take an accidental 30x performance win!

Thanks!

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -638,6 +638,14 @@  class auditvfs(object):
     def mustaudit(self, onoff):
         self.vfs.mustaudit = onoff
 
+    @property
+    def options(self):
+        return self.vfs.options
+
+    @options.setter
+    def options(self, value):
+        self.vfs.options = value
+
 class filtervfs(abstractvfs, auditvfs):
     '''Wrapper vfs for filtering filenames with a function.'''