Use embedded profiling for incremental passes

This commit is contained in:
Grigorii Kirgizov 2019-07-17 17:11:54 +03:00 committed by Fedor Isakov
parent 3d80841639
commit fb384dab39
2 changed files with 10 additions and 7 deletions

View File

@ -52,13 +52,15 @@ internal class ControllerImpl (
}
fun incrLaunch(constraint: Constraint, rulesDiff: RulesDiff): FeedbackStatus {
// todo: use profiler here?
assert(rulesDiff.removedDependent.intersect(rulesDiff.removed).isEmpty())
state.invalidateDependentRules(rulesDiff.removedDependent)
state.invalidateRuleMatches(rulesDiff.removed)
state.addRuleMatches(rulesDiff.added)
val status = state.launchQueue(this)
return status
profiler.profile("invalidation") {
state.invalidateRuleMatches(rulesDiff.removed)
}
profiler.profile("adding_matches") {
state.addRuleMatches(rulesDiff.added)
}
return profiler.profile<FeedbackStatus>("reexecution") {
state.launchQueue(this)
}
}
fun activate(constraint: Constraint) : FeedbackStatus {

View File

@ -69,6 +69,7 @@ internal class ProcessingStateImpl(private var dispatchingFront: Dispatcher.Disp
return controller.reactivate(activeOcc)
}
// todo: remove
fun invalidateDependentRules(ruleIds: Set<Any>) {
val it = this.iterator()
while (it.hasNext()) {