Checkout
stefan2
committed
on 17 Apr 11
After all that preparation, finally introduce in-transaction directory
caching that makes file and folder operations O(1) instead of
O(#dire… Show more
After all that preparation, finally introduce in-transaction directory

caching that makes file and folder operations O(1) instead of

O(#direntries).

The data lookup uses the same functions as non-txn directory data.

We simply need to update the txn-local cache whenever the respective

external (on disk) directory file gets updated or removed.

Please note that the location of the cache object is not ideal as it

resides in fs_fs_data instead of being part of fs_txn_root_data.

But since the latter is a wrapper around the first, it will not be

available in all the places that simply use svn_fs_t. Trying to fix

that requires large-scale rework of function signatures and their

callers.

* subversion/libsvn_fs_fs/fs.h

 (fs_fs_data_t): add new cache instance

* subversion/libsvn_fs_fs/fs_fs.h

 (svn_fs_fs__initialize_caches): differentiate from next function in docstring

 (svn_fs_fs__initialize_txn_caches): declare new private API function

* subversion/libsvn_fs_fs/caching.c

 (remove_txn_cache): new utility function

 (svn_fs_fs__initialize_txn_caches): implement new private API function

* subversion/libsvn_fs_fs/tree.c

 (make_txn_root): initialize txn-local caches when creating a transaction

* subversion/libsvn_fs_fs/fs_fs.c

 (locate_dir_cache): new utility function

 (svn_fs_fs__rep_contents_dir, svn_fs_fs__rep_contents_dir_entry):

  call that new utility function

 (svn_fs_fs__set_entry, svn_fs_fs__delete_node_revision):

  update the txn-local cache whenever the respective txn-local

  files get modified Show less