Add more profiling points
This commit is contained in:
parent
540ac9071f
commit
349cbade85
|
|
@ -36,7 +36,7 @@ fun emptyRuleBits() = BitSet()
|
|||
*
|
||||
* @author Fedor Isakov
|
||||
*/
|
||||
class RuleIndex(): Iterable<Rule>, RuleLookup
|
||||
class RuleIndex(rules: Iterable<Rule>, profiler: Profiler? = null) : Iterable<Rule>, RuleLookup
|
||||
{
|
||||
private class IndexedRule(var idx: Int, val rule: Rule)
|
||||
|
||||
|
|
@ -57,9 +57,11 @@ class RuleIndex(): Iterable<Rule>, RuleLookup
|
|||
|
||||
private val allRules = LinkedList<IndexedRule>()
|
||||
|
||||
constructor(rules: Iterable<Rule>) : this() {
|
||||
init {
|
||||
profiler.profile("build rule index") {
|
||||
buildIndexFromRules(rules)
|
||||
}
|
||||
}
|
||||
|
||||
override fun lookupRuleByTag(tag: Any): Rule? = tag2rule[tag]
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ internal class EvaluationSessionImpl private constructor (
|
|||
open inner class DefaultProcessingSession {
|
||||
|
||||
fun getSession(): SessionData {
|
||||
val ruleIndex = RuleIndex(program.rules())
|
||||
|
||||
val ruleIndex = RuleIndex(program.rules(), profiler)
|
||||
val journal = MatchJournalImpl(trace)
|
||||
val logicalState = LogicalState()
|
||||
val dispatchingFront = Dispatcher(ruleIndex).front()
|
||||
|
|
|
|||
Loading…
Reference in New Issue