[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Efficient propget/proplist of one directories entries?

From: Barry Scott <barry_at_barrys-emacs.org>
Date: 2006-02-23 00:03:48 CET

Anyone have a comment on svn ever helping with this problem?

Barry

On Feb 17, 2006, at 17:51, Barry Scott wrote:

>
> 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
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 23 00:05:14 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.