Truncating profiles and windows outside of plan bounds #417
JoelCourtney
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
Currently we have a performance optimization where at every step during evaluation of a constraints
Expression
tree, the windows and profiles results are truncated to match the simulation bounds. The rationale is that if an external profile has lots of data outside of the horizon, or if constraints are evaluated on a small subset of a very large plan, we can throw out a lot of data that we won't need. Unfortunately I see a couple problems with this:Potential Solution
For now I'd like to remove this behavior. Currently this won't be a large performance penalty most of the time because we don't have incremental simulation. It will only be a performance penalty for large external profiles outside of the plan.
In the long term, @Twisol came up with an idea to lazily apply operations to IntervalMap-backed data structures (i.e. profiles and windows). This could be a decent performance gain in itself because it will avoid reifying the segments ArrayList after every operation. But it will also allow us to reinstate the truncate-to-plan-bounds optimization, because the bounds can be passed backwards through the stack of IntervalMap operations to keep the data that was supposed to be shifted into the bounds.
In both the long and short term, the consumer of the final windows object can decide whether to truncate the results, at the site that uses the AST. I.e. the
GetSimulationResultsAction
can truncate the violations at the evaluation site. The scheduler can do the same inside goals that take Windows expressions.Beta Was this translation helpful? Give feedback.
All reactions