On Feb 17, 2006, at 15:10, Barry Scott wrote:
> It would help speed up my WorkBench GUI if there was an efficient
> way to do a proplist
> of all the entries in a directory. This was discussed in the past
> and I wonder if solving this
> problem is likely and it so when?
>
> I use svn_client_status to get all the status info for one
> directory in an efficient way but
> looping over each file and doing a svn_client_proplist is very slow
> compared to the
> speed of status.
>
> Here is the output of a pysvn test program:
>
> status() elapsed time: 0.071s for 166 entries 0.000426s/entry
> propget() elapsed time: 2.988s for 166 entries 0.018000s/entry
These values where obtained on Mac OS X 10.4 on a 1GHz G4
running svn 1.3.0.
I coded a pure python proplist function and added it to the test here
is the
results:
status() elapsed time: 0.074s for 166 entries 0.000446s/entry
propget() elapsed time: 3.025s for 157 entries 0.019265s/entry
propget2() elapsed time: 0.056s for 157 entries 0.000359s/entry
Its 54 times faster. Of course I'm not locking, which I could do once
for
all 157 entries which I'd guess would not slow things down by much.
And here is myproplist:
def myproplist( path ):
if os.path.isdir( path ):
prop_file = os.path.join( path, '.svn', 'dir-props' )
else:
dirname, basename = os.path.split( status.path )
prop_file = os.path.join( dirname, '.svn', 'props', basename
+ '.svn-work' )
result = {}
try:
f = file( prop_file )
except EnvironmentError:
return []
while True:
line = f.readline()
if line == '':
break
if line == 'END\n':
break
code, length = line.split()
body = f.read( int(length)+1 )
if code == 'K':
key = body[:-1]
elif code == 'V':
result[ key ] = body[:-1]
else:
raise ValueError( 'Unparsed line %s' % line )
f.close()
if len(result) > 0:
return [(str(path), result)]
else:
return []
Barry
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 17 18:52:20 2006