Community
Participate
Working Groups
Created attachment 288681 [details] Screenshot sampling.png With using java 17 on Windows more then half of the time cloning is spend in java.io.File.getCanonicalPath () called from constructor org.eclipse.jgit.internal.storage.file.ObjectDirectory.AlternateHandle.Id.Id(File). That is because getCanonicalPath does not cache the result anymore. Please avoid using getCanonicalPath(): I am sure git does not want to let the OS compute the actual capitalization of all directories in the files path nor follow links. May be the cheap File:getAbsolutePath() is enough? Or if you really need to rely on the OS here then java.nio.file.Files.getFileAttributeView(Path, Class<V>, LinkOption...) + java.nio.file.attribute.BasicFileAttributes.fileKey() could be used instead - since the name is used for comparison only anyway.
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/195186
JDK 12 issue tracking removal of canonicalization cache: https://bugs.openjdk.java.net/browse/JDK-8207005
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/195186 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=2021ce3423a7db6949b9e0a71a8c15e5826ccc4c