You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/05/16 17:24:59 UTC
svn commit: r1103765 - in /subversion/trunk/subversion:
libsvn_wc/update_editor.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h
tests/libsvn_wc/db-test.c tests/libsvn_wc/op-depth-test.c
Author: stefan2
Date: Mon May 16 15:24:59 2011
New Revision: 1103765
URL: http://svn.apache.org/viewvc?rev=1103765&view=rev
Log:
Finding the w/c base folder using svn_wc__db_wcroot_parse_local_abspath
can be expensive if being called for many different paths (e.g. files instead
of their parents whose w/c root information already got cached).
Please note that this may not reduce the total number of stat calls, yet,
as later invocations won't provide an suitable wri_abspath. However, Bert
sees that as the basis to future improvements.
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_base_add_directory, svn_wc__db_base_add_file,
svn_wc__db_base_add_symlink): add wri_abspath parameter
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_base_add_directory, svn_wc__db_base_add_file,
svn_wc__db_base_add_symlink): use wri_abspath to find the w/c base
folder instead of the local_abspath
* subversion/libsvn_wc/update_editor.c
(close_directory, close_file): provide the w/c root to .._db_base_add_*
* subversion/tests/libsvn_wc/op-depth-test.c
(base_dir_insert_remove): adapt callers in test code
* subversion/tests/libsvn_wc/db-test.c
(test_inserting_nodes): dito
Modified:
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/db-test.c
subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1103765&r1=1103764&r2=1103765&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon May 16 15:24:59 2011
@@ -2622,6 +2622,7 @@ close_directory(void *dir_baton,
complete */
SVN_ERR(svn_wc__db_base_add_directory(
eb->db, db->local_abspath,
+ eb->wcroot_abspath,
db->new_relpath,
eb->repos_root, eb->repos_uuid,
*eb->target_revision,
@@ -4136,6 +4137,7 @@ close_file(void *file_baton,
new_checksum = fb->original_checksum;
SVN_ERR(svn_wc__db_base_add_file(eb->db, fb->local_abspath,
+ eb->wcroot_abspath,
fb->new_relpath,
eb->repos_root, eb->repos_uuid,
*eb->target_revision,
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1103765&r1=1103764&r2=1103765&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon May 16 15:24:59 2011
@@ -1495,6 +1495,7 @@ svn_wc__db_get_wcroot(const char **wcroo
svn_error_t *
svn_wc__db_base_add_directory(svn_wc__db_t *db,
const char *local_abspath,
+ const char *wri_abspath,
const char *repos_relpath,
const char *repos_root_url,
const char *repos_uuid,
@@ -1528,8 +1529,9 @@ svn_wc__db_base_add_directory(svn_wc__db
#endif
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
- local_abspath, scratch_pool, scratch_pool));
+ wri_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
+ local_relpath = svn_dirent_skip_ancestor(wcroot->abspath, local_abspath);
blank_ibb(&ibb);
@@ -1576,6 +1578,7 @@ svn_wc__db_base_add_directory(svn_wc__db
svn_error_t *
svn_wc__db_base_add_file(svn_wc__db_t *db,
const char *local_abspath,
+ const char *wri_abspath,
const char *repos_relpath,
const char *repos_root_url,
const char *repos_uuid,
@@ -1608,8 +1611,9 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
SVN_ERR_ASSERT(checksum != NULL);
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
- local_abspath, scratch_pool, scratch_pool));
+ wri_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
+ local_relpath = svn_dirent_skip_ancestor(wcroot->abspath, local_abspath);
blank_ibb(&ibb);
@@ -1657,6 +1661,7 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
svn_error_t *
svn_wc__db_base_add_symlink(svn_wc__db_t *db,
const char *local_abspath,
+ const char *wri_abspath,
const char *repos_relpath,
const char *repos_root_url,
const char *repos_uuid,
@@ -1687,9 +1692,9 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
SVN_ERR_ASSERT(target != NULL);
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
- local_abspath, scratch_pool, scratch_pool));
+ wri_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
-
+ local_relpath = svn_dirent_skip_ancestor(wcroot->abspath, local_abspath);
blank_ibb(&ibb);
/* Calculate repos_id in insert_base_node() to avoid extra transaction */
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1103765&r1=1103764&r2=1103765&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Mon May 16 15:24:59 2011
@@ -448,6 +448,7 @@ svn_wc__db_get_wcroot(const char **wcroo
svn_error_t *
svn_wc__db_base_add_directory(svn_wc__db_t *db,
const char *local_abspath,
+ const char *wri_abspath,
const char *repos_relpath,
const char *repos_root_url,
const char *repos_uuid,
@@ -503,6 +504,7 @@ svn_wc__db_base_add_directory(svn_wc__db
svn_error_t *
svn_wc__db_base_add_file(svn_wc__db_t *db,
const char *local_abspath,
+ const char *wri_abspath,
const char *repos_relpath,
const char *repos_root_url,
const char *repos_uuid,
@@ -583,6 +585,7 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
svn_error_t *
svn_wc__db_base_add_symlink(svn_wc__db_t *db,
const char *local_abspath,
+ const char *wri_abspath,
const char *repos_relpath,
const char *repos_root_url,
const char *repos_uuid,
Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=1103765&r1=1103764&r2=1103765&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Mon May 16 15:24:59 2011
@@ -679,6 +679,7 @@ test_inserting_nodes(apr_pool_t *pool)
set_prop(props, "for-file", "N", pool);
SVN_ERR(svn_wc__db_base_add_directory(
db, svn_dirent_join(local_abspath, "N", pool),
+ local_abspath,
"N", ROOT_ONE, UUID_ONE, 3,
props,
1, TIME_1a, AUTHOR_1,
@@ -690,6 +691,7 @@ test_inserting_nodes(apr_pool_t *pool)
set_prop(props, "for-file", "N/N-a", pool);
SVN_ERR(svn_wc__db_base_add_file(
db, svn_dirent_join(local_abspath, "N/N-a", pool),
+ local_abspath,
"N/N-a", ROOT_ONE, UUID_ONE, 3,
props,
1, TIME_1a, AUTHOR_1,
@@ -701,6 +703,7 @@ test_inserting_nodes(apr_pool_t *pool)
set_prop(props, "for-file", "O", pool);
SVN_ERR(svn_wc__db_base_add_symlink(
db, svn_dirent_join(local_abspath, "O", pool),
+ local_abspath,
"O", ROOT_ONE, UUID_ONE, 3,
props,
1, TIME_1a, AUTHOR_1,
Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1103765&r1=1103764&r2=1103765&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Mon May 16 15:24:59 2011
@@ -1230,6 +1230,7 @@ base_dir_insert_remove(svn_test__sandbox
SVN_ERR(insert_dirs(b, before));
SVN_ERR(svn_wc__db_base_add_directory(b->wc_ctx->db, dir_abspath,
+ dir_abspath,
local_relpath, b->repos_url,
"not-even-a-uuid", revision,
apr_hash_make(b->pool), revision,
Re: svn commit: r1103765 - in /subversion/trunk/subversion:
libsvn_wc/update_editor.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h
tests/libsvn_wc/db-test.c tests/libsvn_wc/op-depth-test.c
Posted by Greg Stein <gs...@gmail.com>.
On May 16, 2011 11:36 AM, "Hyrum K Wright" <hy...@hyrumwright.org> wrote:
>
> On Mon, May 16, 2011 at 3:24 PM, <st...@apache.org> wrote:
> > Author: stefan2
> > Date: Mon May 16 15:24:59 2011
> > New Revision: 1103765
> >
> > URL: http://svn.apache.org/viewvc?rev=1103765&view=rev
> > Log:
> > Finding the w/c base folder using svn_wc__db_wcroot_parse_local_abspath
> > can be expensive if being called for many different paths (e.g. files
instead
> > of their parents whose w/c root information already got cached).
> >
> > Please note that this may not reduce the total number of stat calls,
yet,
> > as later invocations won't provide an suitable wri_abspath. However,
Bert
> > sees that as the basis to future improvements.
>
> Let me see if I understand this (at a high level). Instead of needing
> to fetch the wcroot every time, we provide an already-fetched value to
> avoid having to stat the local_abspath.
>
> I'm not quite sure how I feel about this, personally. I understand
> the need to continue to improve performance, but the additional
> conditionals and baggage resulting in carrying around another value
> and optionally using it feel like it will just muddle the code.
> Rather than require callers to caching and provide this value, it
> seems that a more sensible option would be to implement the cache
> internally.
>
> I don't really know what to do about it right now, other than observe
> that one of the major goals in wc-ng was to make it easier to develop
> with. If we're just going to start making spaghetti anew, that effort
> is for not.
Agreed.
Tge wri_abspath concept is for when you don't have another indicator of the
wcroot you're talking about. We should have one or the other, but not both.
Cheers,
-g
Re: svn commit: r1103765 - in /subversion/trunk/subversion:
libsvn_wc/update_editor.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h
tests/libsvn_wc/db-test.c tests/libsvn_wc/op-depth-test.c
Posted by Greg Stein <gs...@gmail.com>.
On May 16, 2011 11:36 AM, "Hyrum K Wright" <hy...@hyrumwright.org> wrote:
>
> On Mon, May 16, 2011 at 3:24 PM, <st...@apache.org> wrote:
> > Author: stefan2
> > Date: Mon May 16 15:24:59 2011
> > New Revision: 1103765
> >
> > URL: http://svn.apache.org/viewvc?rev=1103765&view=rev
> > Log:
> > Finding the w/c base folder using svn_wc__db_wcroot_parse_local_abspath
> > can be expensive if being called for many different paths (e.g. files
instead
> > of their parents whose w/c root information already got cached).
> >
> > Please note that this may not reduce the total number of stat calls,
yet,
> > as later invocations won't provide an suitable wri_abspath. However,
Bert
> > sees that as the basis to future improvements.
>
> Let me see if I understand this (at a high level). Instead of needing
> to fetch the wcroot every time, we provide an already-fetched value to
> avoid having to stat the local_abspath.
>
> I'm not quite sure how I feel about this, personally. I understand
> the need to continue to improve performance, but the additional
> conditionals and baggage resulting in carrying around another value
> and optionally using it feel like it will just muddle the code.
> Rather than require callers to caching and provide this value, it
> seems that a more sensible option would be to implement the cache
> internally.
>
> I don't really know what to do about it right now, other than observe
> that one of the major goals in wc-ng was to make it easier to develop
> with. If we're just going to start making spaghetti anew, that effort
> is for not.
Agreed.
Tge wri_abspath concept is for when you don't have another indicator of the
wcroot you're talking about. We should have one or the other, but not both.
Cheers,
-g
Re: svn commit: r1103765 - in /subversion/trunk/subversion:
libsvn_wc/update_editor.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h
tests/libsvn_wc/db-test.c tests/libsvn_wc/op-depth-test.c
Posted by Hyrum K Wright <hy...@hyrumwright.org>.
On Mon, May 16, 2011 at 3:24 PM, <st...@apache.org> wrote:
> Author: stefan2
> Date: Mon May 16 15:24:59 2011
> New Revision: 1103765
>
> URL: http://svn.apache.org/viewvc?rev=1103765&view=rev
> Log:
> Finding the w/c base folder using svn_wc__db_wcroot_parse_local_abspath
> can be expensive if being called for many different paths (e.g. files instead
> of their parents whose w/c root information already got cached).
>
> Please note that this may not reduce the total number of stat calls, yet,
> as later invocations won't provide an suitable wri_abspath. However, Bert
> sees that as the basis to future improvements.
Let me see if I understand this (at a high level). Instead of needing
to fetch the wcroot every time, we provide an already-fetched value to
avoid having to stat the local_abspath.
I'm not quite sure how I feel about this, personally. I understand
the need to continue to improve performance, but the additional
conditionals and baggage resulting in carrying around another value
and optionally using it feel like it will just muddle the code.
Rather than require callers to caching and provide this value, it
seems that a more sensible option would be to implement the cache
internally.
I don't really know what to do about it right now, other than observe
that one of the major goals in wc-ng was to make it easier to develop
with. If we're just going to start making spaghetti anew, that effort
is for not.
-Hyrum
Re: svn commit: r1103765 - in /subversion/trunk/subversion:
libsvn_wc/update_editor.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h
tests/libsvn_wc/db-test.c tests/libsvn_wc/op-depth-test.c
Posted by Hyrum K Wright <hy...@hyrumwright.org>.
On Mon, May 16, 2011 at 3:24 PM, <st...@apache.org> wrote:
> Author: stefan2
> Date: Mon May 16 15:24:59 2011
> New Revision: 1103765
>
> URL: http://svn.apache.org/viewvc?rev=1103765&view=rev
> Log:
> Finding the w/c base folder using svn_wc__db_wcroot_parse_local_abspath
> can be expensive if being called for many different paths (e.g. files instead
> of their parents whose w/c root information already got cached).
>
> Please note that this may not reduce the total number of stat calls, yet,
> as later invocations won't provide an suitable wri_abspath. However, Bert
> sees that as the basis to future improvements.
Let me see if I understand this (at a high level). Instead of needing
to fetch the wcroot every time, we provide an already-fetched value to
avoid having to stat the local_abspath.
I'm not quite sure how I feel about this, personally. I understand
the need to continue to improve performance, but the additional
conditionals and baggage resulting in carrying around another value
and optionally using it feel like it will just muddle the code.
Rather than require callers to caching and provide this value, it
seems that a more sensible option would be to implement the cache
internally.
I don't really know what to do about it right now, other than observe
that one of the major goals in wc-ng was to make it easier to develop
with. If we're just going to start making spaghetti anew, that effort
is for not.
-Hyrum