« Return to Thread: Extremely slow HTTPS

Re: Extremely slow HTTPS

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View in Thread

Hello,

 > If I access the Subversion server through a web browser, it is very
fast and
 > nice, but through my Java
 > code it takes about 3,5 minutes to just fetch the 25-30 entries
 > (directories) and print them.
Access through web browser is different from DAV access (which SVNKit
uses). While web browser sends only GET request, SVNKit sends PROPFIND
and other requests to get more information about directory entries, so
accessing with SVNKit will always be slower then web browser one,
however the difference shouldn't be that big.

HTTPS (SSL) is also slower than plain HTTP, as data is encrypted by the
server and decrypted by the client. SVNKit relies on JDK means to
establish SSL connection, also, proxy (if there is any) could add
certain overhead for SSL connection.

So first thing to try is upgrading JDK to the latest version - the
difference could be significant as JDK SSL subsystem is different in JDK
version 1.4 comparing with 1.6 one.

I've just wrote a test code to list
http(s)://svn.svnkit.com/repos/svnkit/trunk and for me time was the same
  (about 1 second) for plain HTTP and SSL protocols (JDK 1.6).

Code is:

SVNRepository repos = SVNRepositoryFactory.create(url);
try {
   Collection entries = repos.getDir("", -1, null, (Collection) null);
   for (Iterator ents = entries.iterator(); ents.hasNext();) {
       SVNDirEntry entry = (SVNDirEntry) ents.next();
       System.out.println(entry.getURL());
   }
} finally {
   repos.closeSession();
}

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

morzach wrote:

> Hello!
>
> Thank you for SVNKit it is really a great library, although I've got some
> problems
> regarding the https protocol.
>
> The thing is that the whole thing works, and at the moment I'm only trying
> to print out a
> repository tree according to the sample at
> https://wiki.svnkit.com/Printing_Out_A_Subversion_Repository_Tree
>
> If I access the Subversion server through a web browser, it is very fast and
> nice, but through my Java
> code it takes about 3,5 minutes to just fetch the 25-30 entries
> (directories) and print them.
> The time is relative to the amount of entries. 7 entries take about 45
> seconds. I have even removed the recursive
> code so that the entries in the root is the only thing that is printed.
> It is this line:
> Collection entries = repository.getDir(path, -1, null, (Collection) null);
> that takes the awful amount of time to get pass.
> If I try to access http://svn.svnkit.com/repos/svnkit/trunk/doc and print
> the tree it is as fast as it should be.
>
> Has anybody else had this problem? Unfortunately I'm doing a project for my
> school and I don't have
> the configuration for the subversion server itself.
> I will give you the entire code below if you need it, thank you very much
> for your replies!
> // Nic
>
> package testing;
>
> import java.util.Collection;
> import java.util.Iterator;
> import org.tmatesoft.svn.core.*;
> import org.tmatesoft.svn.core.auth.*;
> import org.tmatesoft.svn.core.internal.io.dav.*;
> import org.tmatesoft.svn.core.io.*;
> import org.tmatesoft.svn.core.wc.*;
>
> public class DisplayRepositoryTree {
>
>     public static void main(String[] args) {
>
>         String url = "https://server.com/repos";
>         String name = "user";
>         String password = "secret";
>
>         DAVRepositoryFactory.setup();
>
>         SVNRepository repository = null;
>         ISVNAuthenticationManager authManager;
>         long latestRevision = -1;
>        
>         try {
>             SVNURL svnurl = SVNURL.parseURIEncoded(url);
>             repository = DAVRepositoryFactory.create(svnurl);
>             authManager = SVNWCUtil.createDefaultAuthenticationManager(name,
> password);
>             repository.setAuthenticationManager(authManager);
>             latestRevision = repository.getLatestRevision();
>            
>             System.out.println("Repository Root: " +
> repository.getRepositoryRoot(true));
>             System.out.println("Repository UUID: " +
> repository.getRepositoryUUID(true));
>             System.out.println("Repository latest revision: " +
> latestRevision);
>         } catch (SVNException svne) {
>             System.err.println(svne.getMessage());
>             System.exit(1);
>         }
>
>         try {
>             listEntries(repository, "");
>             System.out.println("Entries done");
>
>         } catch (SVNException svne) {
>             System.err.println("listEntries: " + svne.getMessage());
>             System.exit(1);
>         }
>         System.exit(0);
>     }
>    
>     public static void listEntries(SVNRepository repository, String path)
>             throws SVNException {
>
>         Collection entries = repository.getDir(path, -1, null, (Collection)
> null);
>
>         Iterator iterator = entries.iterator();
>         while (iterator.hasNext()) {
>             SVNDirEntry entry = (SVNDirEntry) iterator.next();
>             System.out.println("/" + (path.equals("") ? "" : path + "/") +
> entry.getName() +
>                                " (author: '" + entry.getAuthor() + "';
> revision: " +
>                                entry.getRevision() + "; date: " +
> entry.getDate() + ")");
>         }
>     }
> }

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...

 « Return to Thread: Extremely slow HTTPS

LightInTheBox - Buy quality products at wholesale price