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 2012/05/21 02:23:26 UTC

svn commit: r1340879 - /subversion/trunk/tools/dev/benchmarks/large_dirs/create_bigdir.sh

Author: stefan2
Date: Mon May 21 00:23:26 2012
New Revision: 1340879

URL: http://svn.apache.org/viewvc?rev=1340879&view=rev
Log:
Reduce command line tool invocation overhead:
When deleting many files, use a single batch deletion call to SVN.

* tools/dev/benchmarks/large_dirs/create_bigdir.sh
  (run_svn_del_many): new function
  #main: use new function for batch deletion of files

Modified:
    subversion/trunk/tools/dev/benchmarks/large_dirs/create_bigdir.sh

Modified: subversion/trunk/tools/dev/benchmarks/large_dirs/create_bigdir.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/benchmarks/large_dirs/create_bigdir.sh?rev=1340879&r1=1340878&r2=1340879&view=diff
==============================================================================
--- subversion/trunk/tools/dev/benchmarks/large_dirs/create_bigdir.sh (original)
+++ subversion/trunk/tools/dev/benchmarks/large_dirs/create_bigdir.sh Mon May 21 00:23:26 2012
@@ -124,6 +124,20 @@ run_svn_del() {
   fi
 }
 
+run_svn_del_many() {
+  printf "\n" > files.lst
+  sequence=`get_sequence 2 ${1}`
+  for i in $sequence; do
+    printf "$WC/${1}_c/$i\n" >> files.lst
+  done
+
+  if [ "${VALGRIND}" = "" ] ; then
+    time ${SVN} del -q --targets files.lst > /dev/null
+  else
+    ${VALGRIND} ${VG_OUTFILE}="${VG_TOOL}.out.del_many.$1" ${SVN} del -q --targets files.lst > /dev/null
+  fi
+}
+
 run_svn_ci() {
   if [ "${VALGRIND}" = "" ] ; then
     time ${SVN} ci $WC/$1 -m "" -q > /dev/null
@@ -185,12 +199,13 @@ while [ $FILECOUNT -lt $MAXCOUNT ]; do
   run_svn_del ${FILECOUNT} 1
 
   printf "\tDeleting files ... \t"
-  time sh -c "
-  for i in $sequence; do
-    ${SVN} del $WC/${FILECOUNT}_c/\$i -q
-  done "
+  if [ "$FILECOUNT" == "1" ] ; then
+    printf " skipped (0 files to delete)\n"
+  else
+    run_svn_del_many ${FILECOUNT}
+  fi
 
-  printf "\tCommit deletions ...\t"
+  printf "\tCommit deletions ..\t"
   run_svn_ci ${FILECOUNT}_c del
 
   rm -rf $WC