« Return to Thread: Extremely slow HTTPS

Extremely slow HTTPS

by morzach :: Rate this Message:

Reply to Author | View in Thread

Hello!

Thank you for SVNKit it is really a great library, although I've got some problems
regarding the https protocol. Of course I am using the latest SVNKit version and JDK.

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() + ")");
        }
    }
}

 « Return to Thread: Extremely slow HTTPS

LightInTheBox - Buy quality products at wholesale price