From 084090e7081aa33f0c6db40631b135ce67bad831 Mon Sep 17 00:00:00 2001 From: Aleksander Boruch-Gruszecki Date: Mon, 25 Mar 2019 14:15:24 +0100 Subject: [PATCH] Check the performance impact of tracing isSubType We have a what are essentially non-local returns inside `recur`. The cost of throwing exceptions inside a heavily used operation might be non-trivial. --- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 3e7fce488a6a..ec2bfd1c7b59 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -176,7 +176,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] { * code would have two extra parameters for each of the many calls that go from * one sub-part of isSubType to another. */ - protected def recur(tp1: Type, tp2: Type): Boolean = trace(s"isSubType ${traceInfo(tp1, tp2)} $approx", subtyping) { + protected def recur(tp1: Type, tp2: Type): Boolean = { def monitoredIsSubType = { if (pendingSubTypes == null) {