You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm profiling a build using the latest Zinc. I'll use this ticket to record the areas where Zinc could be improved.
JarUtils.ClassInJar
The build is using straight-to-JAR compilation. This seems to be an allocation hotspot within:
jo2o(output.getSingleOutputAsPath) match {
case Some(so) if so.getFileName.toString.endsWith(".jar") =>
knownProducts foreach { product =>
new JarUtils.ClassInJar(product.id).toClassFilePath foreach { path =>
ps.add(path.replace('\\', '/'))
}
}
The main optimization would be to avoid repeatedly calling new File in ClassInJar.splitJarReference on what I presume is always the same path (the path of the JAR), and is anyway discarded by def toClassFilePath: Option[ClassFilePath] = splitJarReference._2!
new File internally incurs String allocations, at least on Windows, in WinNTFileSystem.normalize.
I am also inclined to remove use of parallel collections should be used in knownProducts.
This is also inefficient:
val Array(jar, cls) = toString.split("!")
The text was updated successfully, but these errors were encountered:
I'm profiling a build using the latest Zinc. I'll use this ticket to record the areas where Zinc could be improved.
JarUtils.ClassInJar
The build is using straight-to-JAR compilation. This seems to be an allocation hotspot within:
The main optimization would be to avoid repeatedly calling
new File
inClassInJar.splitJarReference
on what I presume is always the same path (the path of the JAR), and is anyway discarded bydef toClassFilePath: Option[ClassFilePath] = splitJarReference._2
!new File
internally incurs String allocations, at least on Windows, inWinNTFileSystem.normalize
.I am also inclined to remove use of parallel collections should be used in
knownProducts
.This is also inefficient:
The text was updated successfully, but these errors were encountered: