mirror of https://github.com/sbt/sbt.git
Stop filling json codec cache
These were not actually used as far as I could tell. The json codecs cache showed up as taking up 30MB in a heap dump that I took after running compile 30 times in a clone of the repro project in https://github.com/sbt/sbt/issues/5508.
This commit is contained in:
parent
6c50a85f93
commit
46724159da
|
|
@ -24,7 +24,6 @@ sealed abstract class LogExchange {
|
||||||
private[sbt] lazy val context: LoggerContext = init()
|
private[sbt] lazy val context: LoggerContext = init()
|
||||||
private[sbt] lazy val builtInStringCodecs: Unit = initStringCodecs()
|
private[sbt] lazy val builtInStringCodecs: Unit = initStringCodecs()
|
||||||
private[sbt] lazy val asyncStdout: AsyncAppender = buildAsyncStdout
|
private[sbt] lazy val asyncStdout: AsyncAppender = buildAsyncStdout
|
||||||
private[sbt] val jsonCodecs: concurrent.Map[String, JsonFormat[_]] = concurrent.TrieMap()
|
|
||||||
private[sbt] val stringCodecs: concurrent.Map[String, ShowLines[_]] = concurrent.TrieMap()
|
private[sbt] val stringCodecs: concurrent.Map[String, ShowLines[_]] = concurrent.TrieMap()
|
||||||
|
|
||||||
def logger(name: String): ManagedLogger = logger(name, None, None)
|
def logger(name: String): ManagedLogger = logger(name, None, None)
|
||||||
|
|
@ -100,12 +99,15 @@ sealed abstract class LogExchange {
|
||||||
lo
|
lo
|
||||||
}
|
}
|
||||||
|
|
||||||
def jsonCodec[A](tag: String): Option[JsonFormat[A]] =
|
@deprecated("It is now necessary to provide a json format instance", "1.4.0")
|
||||||
jsonCodecs.get(tag) map { _.asInstanceOf[JsonFormat[A]] }
|
def jsonCodec[A](tag: String): Option[JsonFormat[A]] = None
|
||||||
def hasJsonCodec(tag: String): Boolean =
|
@deprecated("Always returns false", "1.4.0")
|
||||||
jsonCodecs.contains(tag)
|
def hasJsonCodec(tag: String): Boolean = false
|
||||||
def getOrElseUpdateJsonCodec[A](tag: String, v: JsonFormat[A]): JsonFormat[A] =
|
@deprecated("This is a no-op", "1.4.0")
|
||||||
jsonCodecs.getOrElseUpdate(tag, v).asInstanceOf[JsonFormat[A]]
|
def getOrElseUpdateJsonCodec[A](tag: String, v: JsonFormat[A]): JsonFormat[A] = v
|
||||||
|
@deprecated("The log manager no longer caches jsonCodecs", "1.4.0")
|
||||||
|
def jsonCodecs(): concurrent.Map[String, JsonFormat[_]] = concurrent.TrieMap.empty
|
||||||
|
|
||||||
def stringCodec[A](tag: String): Option[ShowLines[A]] =
|
def stringCodec[A](tag: String): Option[ShowLines[A]] =
|
||||||
stringCodecs.get(tag) map { _.asInstanceOf[ShowLines[A]] }
|
stringCodecs.get(tag) map { _.asInstanceOf[ShowLines[A]] }
|
||||||
def hasStringCodec(tag: String): Boolean =
|
def hasStringCodec(tag: String): Boolean =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue