Skip to content

Commit

Permalink
Add note on possible future filtering optimization. (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi authored Nov 8, 2024
1 parent 51c331e commit d7a1cae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trustfall_core/src/interpreter/filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ fn apply_filter_op<
left: &FieldValue,
right: &RightValue,
) -> Option<DataContext<Vertex>> {
// TODO: This is a missed optimization opportunity:
// It's possible that computing the arguments for the filter function was expensive,
// and we might have been able to skip it if `ctx.within_nonexistent_optional()` is true.
// With the current impl, we fail to do so.
// For example: we may have created a Regex value from a tag, or used a `@transform` on
// a property to perform some computation on either the left or right value (#617).
(ctx.within_nonexistent_optional() || filter_op(left, right)).then_some(ctx)
}

Expand Down

0 comments on commit d7a1cae

Please sign in to comment.