You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Fuhrman <st...@alice-dsl.de> on 2010/04/06 17:56:12 UTC

[PATCH] Fix O(n) runtime in cache lookup, part 2/2

Hi devs,

this is a follow-up to the previous patch.
It uses the extended cache interface to
bring directory traversal times down from
O(N^2) to amortized O(N).

dir_entry_id_from_node now calls the new
svn_fs_fs__dag_dir_entry function that
duplicates only one entry instead of all
under the given node.

[[[
Allow for cache entries to be access directly, i.e. without
prior copying. Use that to fix FSFS directory traversal
runtime from O(N^2) to O(n).

* subversion/libsvn_fs_fs/dag.c
  (dir_entry_id_from_node): call the new, efficient
  lookup function.
  (svn_fs_fs__dag_dir_entry): implement the new
  lookup function
  (svn_fs_fs__dag_dir_entries, svn_fs_fs__dag_delete):
  adapt to svn_fs_fs__rep_contents_dir signature change

* subversion/libsvn_fs_fs/dag.h
  (svn_fs_fs__dag_dir_entry): declare new function

* subversion/libsvn_fs_fs/fs_fs.c
  (svn_fs_fs__rep_contents_dir): add support for optionally
  returning a pinned cache reference instead of a copy.
  (svn_fs_fs__set_entry, write_final_rev): adapt to
  svn_fs_fs__rep_contents_dir signature change

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__rep_contents_dir): add pin parameter

patch by stefanfuhrmann < at > alice-dsl.de
]]]