Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance: Repeated evaluation of incomplete expressions #2852

Open
1 task
myitcv opened this issue Feb 22, 2024 · 0 comments
Open
1 task

Performance: Repeated evaluation of incomplete expressions #2852

myitcv opened this issue Feb 22, 2024 · 0 comments
Assignees

Comments

@myitcv
Copy link
Member

myitcv commented Feb 22, 2024

Field evaluations may depend on full evaluation of other fields. This means that, ideally, they need to be evaluated in a certain order. The current evaluator requeues an expression for evaluation if a dependency cannot immediately be evaluated. It then keeps reevaluating until a fixed point is reached.

The way CUE has evolved, this now means that an expression may sometimes be evaluated several times. This is especially bad when these expressions are expensive, such as large comprehensions.

The new evaluator, instead of simply requeuing, builds a dependency graph that ensures that a blocked expression will only be restarted if a dependency is resolved. This reduces the time complexity for processing a list of expressions for a node from $O(n^2)$ to $O(n)$.

This performance sub-issue captures details and narrative specific to performance issues related to unnecessary reevaluation of dependencies. We will post updates and commentary related to this topic below.

The umbrella performance issue captures higher-level performance updates.

Existing comprehension-related bug reports/issues

@myitcv myitcv moved this from Backlog to In progress in Evaluator Roadmap Feb 22, 2024
@cue-lang cue-lang locked as resolved and limited conversation to collaborators Feb 22, 2024
@myitcv myitcv mentioned this issue Feb 22, 2024
@cue-lang cue-lang unlocked this conversation Feb 22, 2024
@myitcv myitcv changed the title Placeholder 3 Performance: Repeated evaluation of incomplete expressions Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

No branches or pull requests

2 participants