|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Extremely slow HTTPSHello!
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() + ")"); } } } |
|
|
Re: Extremely slow HTTPSHello,
> 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@... |
|
|
Re: Extremely slow HTTPSHello again!
Thank you very much for your answer :) Unfortunately I still cannot get it to work and I've tried using both JDK 1.5 and JDK 1.6. Also tried the latest SVNKit 1.1.7.4142 and 1.2.0.4151 but still the same results. I will investigate this matter and try to find the people responsible for the SVN server :) Again, thanks for your reply, really appreciated. // Nic
|
| Free Forum Powered by Nabble | Forum Help |