diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/MatchTrie.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/MatchTrie.kt index 7957a12b..e761cb06 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/MatchTrie.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/MatchTrie.kt @@ -238,7 +238,7 @@ internal class MatchTrie(val rule: Rule, // INCONCLUSIVE may yield some (ir-)relevant results // NONE means no results could have been found at all, so it's useless to attempt again with the same input private fun lookupAuxOccurrences(cst: Constraint): Pair> { - return profiler.profile>> ("lookupAuxOccurrences") { + return profiler.profile>> ("lookupAux_${cst.symbol()}") { val cache = ArrayList(4) for (arg in cst.arguments()) { diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Matcher.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Matcher.kt index 454b7620..31158b79 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Matcher.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Matcher.kt @@ -14,6 +14,7 @@ import jetbrains.mps.unification.Substitution import jetbrains.mps.unification.Term import jetbrains.mps.unification.TermWrapper import jetbrains.mps.unification.Unification +import org.jetbrains.kotlin.container.topologicalSort import java.util.* import com.github.andrewoma.dexx.collection.List as PersList @@ -29,10 +30,12 @@ class Matcher(val ruleIndex: RuleIndex, { private val matchTries: List by lazy(LazyThreadSafetyMode.NONE) { - ArrayList(4).apply { + profiler.profile>("lookupRules_${activeOcc.constraint().symbol()}") { - for(rule in ruleIndex.forOccurrence(activeOcc)) { - add(MatchTrie(rule, activeOcc, aux, profiler)) + ArrayList(4).apply { + for(rule in ruleIndex.forOccurrence(activeOcc).toList()) { + add(MatchTrie(rule, activeOcc, aux, profiler)) + } } }