Open
Description
Profiles reveal a hotspot at:
case TypeRef(_, sym, _) if sym.isAbstractType => tp.bounds.hi.typeSymbol isSubClass SingletonClass
When tp
is an ExistentialType
, which defines:
override def bounds = TypeBounds(maybeRewrap(underlying.bounds.lo), maybeRewrap(underlying.bounds.hi))
- Avoid repeated calls to
underlying.bounds
- Are there cheap tests we can make on
underlying.bounds.{lo,hi}
to avoid the need to callmaybeRewrap
? PerhapsAny
/ Nothing` are common and don't need to be wrapped in the existential?