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