Skip to content

Optimize UI5 predicate evaluation for getModel & getNode#302

Merged
data-douser merged 2 commits intomainfrom
dd/ui5-perf/1
Feb 17, 2026
Merged

Optimize UI5 predicate evaluation for getModel & getNode#302
data-douser merged 2 commits intomainfrom
dd/ui5-perf/1

Conversation

@data-douser
Copy link
Copy Markdown
Collaborator

What This PR Contributes

Summary of Changes

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.

Outline of Changes

Model association logic refactoring:

  • Extracted the logic for finding a DefaultODataServiceModel in fragments (when no explicit setModel call exists) into a new helper predicate getDefaultODataModel, improving readability and separation of concerns. [1] [2]
  • Moved the logic for associating a non-statically-visible JsonModel with a binding path into a new helper predicate getNonStaticJsonModelNode, making the code easier to follow.
  • Moved the logic for finding an external (server-side) model node into a new helper predicate getExternalModelNode, reducing duplication and clarifying intent.

Code organization and maintainability:

  • Marked new helper predicates with the nomagic pragma to prevent unintended inlining and to keep cross-flow analysis modular and efficient.

Future Works

N/A

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.
@data-douser data-douser requested a review from Copilot February 17, 2026 01:45
@data-douser data-douser self-assigned this Feb 17, 2026
@data-douser data-douser added the enhancement New feature or request label Feb 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DefaultODataServiceModel lookup logic into getDefaultODataModel helper predicate with an early guard restricting to .fragment.xml files
  • Extracted non-static JsonModel lookup logic into getNonStaticJsonModelNode helper predicate
  • Extracted external model lookup logic into getExternalModelNode helper predicate

@data-douser data-douser marked this pull request as ready for review February 17, 2026 02:06
@data-douser data-douser enabled auto-merge (squash) February 17, 2026 02:09
Copy link
Copy Markdown
Contributor

@mbaluda mbaluda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@data-douser data-douser merged commit 9bf2f04 into main Feb 17, 2026
15 checks passed
@data-douser data-douser deleted the dd/ui5-perf/1 branch February 17, 2026 09:39
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.

3 participants