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

Re: svn commit: r1089257 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c wc-queries.sql wc_db.c wc_db.h

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 7 Apr 2011 04:35:51 +0300

Hyrum K Wright wrote on Wed, Apr 06, 2011 at 11:44:47 -0500:
> On Wed, Apr 6, 2011 at 7:58 AM, Greg Stein <gstein_at_gmail.com> wrote:
> >...
> >>...
> >> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Apr  5 21:53:47 2011
> >>...
> >>  svn_error_t *
> >> +svn_wc__db_changelist_list_notify(svn_wc_notify_func2_t notify_func,
> >> +                                  void *notify_baton,
> >> +                                  svn_wc__db_t *db,
> >> +                                  const char *local_abspath,
> >> +                                  apr_pool_t *scratch_pool)
> >> +{
> >
> > Should the contents of this function be transacted?
>
> Not needed: the contents of the temporary table are only visible to
> the database connection that created them (and the table itself will
> automatically disappear when the connection is closed). As a result,
> no other connection or thread could interact with this table while
> this function is running.
>

Using a transaction is twice as fast for me in the following testcsae:

[[[
% cat foo.sh
#!/bin/zsh

x=`for i in $(seq 100000); do echo "insert into foo(i) values($i);"; done`
y="create temporary table foo (i integer); create index ii on foo(i);"

time sqlite3 :memory: <<< "$y; $x;"
time sqlite3 :memory: <<< "$y; BEGIN; $x; COMMIT;"
% zsh -e foo.sh
sqlite3 :memory: <<< "$y; $x;" 1.42s user 1.23s system 97% cpu 2.707 total
sqlite3 :memory: <<< "$y; BEGIN; $x; COMMIT;" 0.74s user 0.01s system 99% cpu 0.745 total
]]]

(the <<< operator is a one-line heredoc, 'redirect this string to the
process's stdin)

> -Hyrum
Received on 2011-04-07 03:37:47 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.