Optimize UI5 predicate evaluation for getModel & getNode#302
Merged
data-douser merged 2 commits intomainfrom Feb 17, 2026
Merged
Optimize UI5 predicate evaluation for getModel & getNode#302data-douser merged 2 commits intomainfrom
getModel & getNode#302data-douser merged 2 commits intomainfrom
Conversation
Extract expensive disjuncts from getModel() and getNode() into pragma[nomagic] helper predicates to reduce redundant evaluation: - getDefaultODataModel: isolates FragmentLoad cross-flow analysis, adds early guard restricting to .fragment.xml files - getNonStaticJsonModelNode: separates non-static JsonModel lookup - getExternalModelNode: prevents getModel() inlining into getNode() Achieves ~35% reduction in per-query evaluation time on a representative codebase. All 72 existing unit tests pass with identical results.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes the performance of UI5 predicate evaluation by extracting expensive disjuncts from getModel() and getNode() into separate helper predicates marked with pragma[nomagic]. This prevents redundant evaluation and reduces query evaluation time by approximately 35% on representative codebases.
Changes:
- Extracted fragment-specific
DefaultODataServiceModellookup logic intogetDefaultODataModelhelper predicate with an early guard restricting to.fragment.xmlfiles - Extracted non-static
JsonModellookup logic intogetNonStaticJsonModelNodehelper predicate - Extracted external model lookup logic into
getExternalModelNodehelper predicate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This PR Contributes
Summary of Changes
Extract expensive disjuncts from getModel() and getNode() into pragma[nomagic] helper predicates to reduce redundant evaluation:
Achieves ~35% reduction in per-query evaluation time on a representative codebase. All 72 existing unit tests pass with identical results.
Outline of Changes
Model association logic refactoring:
DefaultODataServiceModelin fragments (when no explicitsetModelcall exists) into a new helper predicategetDefaultODataModel, improving readability and separation of concerns. [1] [2]JsonModelwith a binding path into a new helper predicategetNonStaticJsonModelNode, making the code easier to follow.getExternalModelNode, reducing duplication and clarifying intent.Code organization and maintainability:
nomagicpragma to prevent unintended inlining and to keep cross-flow analysis modular and efficient.Future Works
N/A