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

Re: Need fast ways to get Info once WC-NG is introduced

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Tue, 03 Aug 2010 22:59:13 +0200

On 03.08.2010 12:42, Philip Martin wrote:
> Stefan Küng<tortoisesvn_at_gmail.com> writes:
>
>> On 02.08.2010 12:32, Bert Huijben wrote:
>>>> So is there an (almost as) fast way to check whether a folder is
>>>> versioned or not?
>>>
>>> I think the fastest way in the current code would be to call
>>> svn_wc_read_kind() on the directory, maybe after first checking that there
>>> is some .svn in at least one of the parent directories.
>>
>> I thought about implementing a small cache for that, so that I don't
>> have to walk up the tree every time to find an .svn dir.
>> But I thought I read something about such a small cache getting
>> implemented in the svn library itself so I wanted to ask first - maybe
>> there's already an API to use that cache. Or maybe I just remember it
>> wrong.
>
> Does TSVN cache/reuse svn_client_ctx_t handles? In 1.7 the client
> context contains an opaque wc context which in turn includes a
> database context, svn_wc__db_t. The database context caches sqlite
> connections and has a cache mapping directory->database.

No, the TSVN cache doesn't reuse those at the moment. I might change
that though...

> Quite when TSVN should create/destroy svn_client_ctx_t is an
> interesting question. Reusing a long-lived context (or perhaps a
> small number, one per-thread say) is likely to make individual svn
> calls faster. However the open database handles means that Windows
> won't be able to delete root directories. It's not clear to me how
> or when TSVN would close those handles.

That's why I currently don't reuse SVN pools and contexts. There is a
mechanism in place which tells the cache to release all handles, but it
isn't very reliable. I will have to test whether I can reuse the
contexts or whether I have to recreate them.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
Received on 2010-08-03 22:59:53 CEST

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.