Don't use managedCache for library stamps

Using the managedCached introduced an unintended performance regression
because it ensured that we always computed the hash of each jar on the
dependency classpath. The backing ReadStamps only computes the stamp if
the timestamp of the jar has changed.
This commit is contained in:
Ethan Atkins 2020-07-27 15:33:51 -07:00
parent b345205c28
commit c9dc041643
1 changed files with 1 additions and 7 deletions

View File

@ -231,13 +231,7 @@ object Defaults extends BuildCommon {
def getAllSourceStamps()
: java.util.Map[xsbti.VirtualFileRef, xsbti.compile.analysis.Stamp] =
new java.util.HashMap[xsbti.VirtualFileRef, xsbti.compile.analysis.Stamp]
def library(fr: xsbti.VirtualFileRef): xsbti.compile.analysis.Stamp = {
val path = converter.toPath(fr)
managedCache
.getOrElseUpdate(path, sbt.nio.FileStamper.Hash)
.map(_.stamp)
.getOrElse(backing.library(fr))
}
def library(fr: xsbti.VirtualFileRef): xsbti.compile.analysis.Stamp = backing.library(fr)
def product(fr: xsbti.VirtualFileRef): xsbti.compile.analysis.Stamp = backing.product(fr)
def source(fr: xsbti.VirtualFile): xsbti.compile.analysis.Stamp = {
val path = converter.toPath(fr)