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

Optimization of status-query on multiple files in a common directory

From: Beckmann, Thomas <thomas.beckmann_at_logica.com>
Date: Tue, 24 Aug 2010 13:36:42 +0200

Dear developers,

 

 

I am facing the following problem I tracked down to an optimization of the status query that appears to be of 2004. I am automating the commit dialog of TortoiseSVN by passing a list of files using the /pathfile command line parameter. When committing multiple files from a number of directories of my working copy the modification status gets displayed within seconds. Now, when providing two or more files from a single directory however it takes ages (5+ minutes).

 

There is an optimization in SVNStatusListCtrl.cpp::GetStatus(), Line 383. In case of multiple files from a common directory a single status query is issued and the relevant results are filtered. In my case the directory contains 5000+ files and I want to commit only 2 of them.

 

- Despite filtering, are there any side-effects when using the non-optimized multiple-query code path over the single directory and filtering code path?

- Maybe one could increase the optimize condition to say more than 32 files or so, maybe even based on the percentage of files being queried relative to the number of files in the directory?

- Or maybe the optimization of 2004 is outdated with respect to how Subversion is working internally. Could one dismiss the directory query code path altogether?

 

What would be an acceptable solution for the problem? Below an extract of the code in question.

 

 

Regards,

   Thomas Beckmann.

 

 

SVNStatus status(m_pbCanceled);

if(m_nTargetCount > 1 && sortedPathList.AreAllPathsFilesInOneDirectory())

{

      // This is a special case, where we've been given a list of files

      // all from one folder

      // We handle them by setting a status filter, then requesting the SVN status of

      // all the files in the directory, filtering for the ones we're interested in

      status.SetFilter(sortedPathList);

 

      // if all selected entries are files, we don't do a recursive status

      // fetching. But if only one is a directory, we have to recurse.

      svn_depth_t depth = svn_depth_files;

      // We have set a filter. If all selected items were files or we fetch

      // the status not recursively, then we have to include

      // ignored items too - the user has selected them

      bool bShowIgnoresRight = true;

      for (int fcindex=0; fcindex<sortedPathList.GetCount(); ++fcindex)

      {

            if (sortedPathList[fcindex].IsDirectory())

            {

                  depth = m_bDepthInfinity ? svn_depth_infinity : svn_depth_unknown;

                  bShowIgnoresRight = false;

                  break;

            }

      }

      if(!FetchStatusForSingleTarget(config, status, sortedPathList.GetCommonDirectory(), bUpdate, sUUID, arExtPaths, true, depth, bShowIgnoresRight))

      {

            bRet = FALSE;

      }

}

else

{

      for(int nTarget = 0; nTarget < m_nTargetCount; nTarget++)

      {

            // check whether the path we want the status for is already fetched due to status-fetching

            // of a parent path.

            // this check is only done for file paths, because folder paths could be included already

            // but not recursively

            if (sortedPathList[nTarget].IsDirectory() || GetListEntry(sortedPathList[nTarget]) == NULL)

            {

                  if(!FetchStatusForSingleTarget(config, status, sortedPathList[nTarget], bUpdate, sUUID, arExtPaths, false, m_bDepthInfinity ? svn_depth_infinity : svn_depth_unknown, bShowIgnores))

                  {

                        bRet = FALSE;

                  }

            }

      }

}

 

-- 
Thomas Beckmann | Technische Produktentwicklung SAMBAplus
Dieselstraße 18/2, 70771 Leinfelden-Echterdingen | Germany
T: +49 711 - 90273 - 950 | F: +49 711 90273 - 37 
thomas.beckmann@logica.com <mailto:thomas.beckmann@logica.com>  | www.logica.de <http://www.logica.de/>  | sambaplus.de.logica.com <http://sambaplus.de.logica.com/> 
Logica Deutschland GmbH & Co. KG
Zettachring 4, 70567 Stuttgart; Amtsgericht Stuttgart HRA 722072
Persönlich haftender Gesellschafter: Logica Deutschland Verwaltungs GmbH
Geschäftsführer: Torsten Straß (Vors.) | Steven Blythe | Dr. Markus Feidicker | Olaf Scholz | Oliver Starzonek | Dr. Alexander Wurdack
Handelsregister: AG Stuttgart HRB 724084
 
Please help Logica to respect the environment by not printing this email  / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2650657
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-08-24 13:59:58 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.