Skip to content

Improve performance of precondition applicability checks#3

Merged
argaman-aloni merged 2 commits intoargaman-aloni:mainfrom
yarinbnyamin:improve-applicability-check
Mar 10, 2026
Merged

Improve performance of precondition applicability checks#3
argaman-aloni merged 2 commits intoargaman-aloni:mainfrom
yarinbnyamin:improve-applicability-check

Conversation

@yarinbnyamin
Copy link
Contributor

This PR improves the performance of _is_condition_applicable by implementing short-circuit evaluation:

  • For and operations, returns False immediately if any operand fails.
  • For or operations, returns True immediately if any operand succeeds.
  • Benchmarks show 20–40% faster performance for typical workloads with multiple preconditions.

This avoids unnecessary evaluation of remaining operands and makes precondition checking significantly more efficient without changing correctness.

@argaman-aloni argaman-aloni self-requested a review March 9, 2026 14:46
@yarinbnyamin yarinbnyamin marked this pull request as draft March 9, 2026 16:13
@yarinbnyamin yarinbnyamin marked this pull request as ready for review March 9, 2026 16:14
@argaman-aloni argaman-aloni added the enhancement New feature or request label Mar 10, 2026
@argaman-aloni argaman-aloni merged commit acbf742 into argaman-aloni:main Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants