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

Re: [Subclipse-dev] Help needed - Subclipse performance problem

From: Brock Janiczak <brockj_at_tpg.com.au>
Date: 2006-02-18 23:59:59 CET

Mark Phippard wrote:
> Brock,
>
> Sorry for not quoting any of your message, I am in a crappy Webmail client.
>
> The behavior we say was that we would see the Sending messages about 1 per
> second, eventually 1 per 3 seconds, eventually 1 per 30 seconds eventually
> crashed JVM. Never gets to the Transmitting data stage. So clearly the
> problem lies within the notification handling somewhere.
>
Are you using JavaSVN or JavaHL? I have done all of my testing with
JavaHL and have had no trouble with 4000 files (other than with the add
operation itself)
> As for your patch, isn't the purpose of a Set that it does not allow
> duplicates? If so, what good is it to check if contains the item? Could
> the problem be that the item we are storing does not implement the
> hashCode() method properly? Doesn't Set rely on this method to determine
> if it is a duplicate?
>
Yes, the set will use the has code to find the corresponding bucket and
then equals to find the exact match. We store IResources (Folders), so
i would assume the equals/hashcode methods are implemented correctly.
The patch was to see if there was a bug in the JDK collection code. If
the set is working as it should be you should not get out of memory
errors with only a few hundred items in the set.

What JDK version are you using? I have checked the linked hash map
implementation on 5.0 and 6.0 and i can not see how it can grow if the
items are equal. I have been unable to look at the 1.4.2 implementation.

One thing i did find while trying to reproduce the slowness was that the
AddResourcesCommand is getting the status one at a time for each
resource which makes it painfully slow. I have attached a patch for
this issue. It could be further improved by not recursively updating
the automatically added parents.
> Mark
>
>
> _____________________________________________________________________________
> Scanned for SoftLanding Systems, Inc. and SoftLanding Europe Plc by IBM Email Security Management Services powered by MessageLabs.
> _____________________________________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subclipse.tigris.org
> For additional commands, e-mail: dev-help@subclipse.tigris.org
>
>
>
>

Index: D:/data/eclipse/workspace/core/src/org/tigris/subversion/subclipse/core/commands/AddResourcesCommand.java
===================================================================
--- D:/data/eclipse/workspace/core/src/org/tigris/subversion/subclipse/core/commands/AddResourcesCommand.java (revision 2099)
+++ D:/data/eclipse/workspace/core/src/org/tigris/subversion/subclipse/core/commands/AddResourcesCommand.java (working copy)
@@ -9,8 +9,10 @@
  *******************************************************************************/
 package org.tigris.subversion.subclipse.core.commands;
 
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
@@ -22,6 +24,7 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.team.core.TeamException;
+import org.tigris.subversion.subclipse.core.ISVNLocalFolder;
 import org.tigris.subversion.subclipse.core.ISVNLocalResource;
 import org.tigris.subversion.subclipse.core.Policy;
 import org.tigris.subversion.subclipse.core.SVNException;
@@ -69,6 +72,8 @@
         // and the depth isn't zero
         final HashSet files = new HashSet();
         
+ List rootResources = new ArrayList();
+
         for (int i=0; i<resources.length; i++) {
             
             final IResource currentResource = resources[i];
@@ -82,7 +87,9 @@
                     parent = parent.getParent();
                     svnParentResource = svnParentResource.getParent();
                 }
-
+
+ rootResources.add(svnParentResource);
+
                 // Auto-add children accordingly to depth
                 final SVNException[] exception = new SVNException[] { null };
                 currentResource.accept(new IResourceVisitor() {
@@ -125,7 +132,6 @@
   
                 try {
                     svnClient.addDirectory(localResource.getIResource().getLocation().toFile(),false);
- localResource.refreshStatus();
                 } catch (SVNClientException e) {
                     throw SVNException.wrapException(e);
                 }
@@ -139,11 +145,19 @@
                     // If file has read-only attribute set, remove it
                     if (localResource.getIResource().getType() == IResource.FILE && localResource.getIResource().isReadOnly())
                         localResource.getIResource().setReadOnly(false);
- localResource.refreshStatus();
                 } catch (SVNClientException e) {
                     throw SVNException.wrapException(e);
                 }
             }
+
+ for (Iterator it = rootResources.iterator(); it.hasNext();) {
+ ISVNLocalResource root = (ISVNLocalResource)it.next();
+ if (root instanceof ISVNLocalFolder) {
+ ((ISVNLocalFolder)root).refreshStatus(IResource.DEPTH_INFINITE);
+ } else {
+ root.refreshStatus();
+ }
+ }
                 
 
         } finally {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: dev-help@subclipse.tigris.org
Received on Sun Feb 19 00:02:12 2006

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