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

ST6RI-795 Improve performance of validation involving inherited memberships #594

Merged
merged 11 commits into from
Oct 11, 2024

Conversation

seidewitz
Copy link
Member

This PR implements performance improvements for the computation of the inherited memberships of a namespace, primarily in a set of methods in the TypeAdapter.

Through performance profiling, it was determined that the time spent doing validation was dominated by validation checks on namespaces, functions and expressions that required the computation of inherited members. In addition, some of the most time-expensive transformations also required this computation, in order to get the inherited ends of connectors and connection usages. Improving the performance of the inheritance computation was thus seen to have a potentially high impact.

Further analysis indicated that the major performance cost in the inheritance computation was in removing memberships due to redefinition relationships. Two major changes were implemented to address this:

  1. The removal of redefined features is now handled incrementally as the specialization graph is traversed to collect inherited memberships, rather than by a second pass run after a initial set of memberships is collected. (This is similar to the approach used to handle redefinition for name resolutions in KerMLScope.)
  2. As the indirectly redefined features are determined for particular redefining features and for all the features in a type, this information is cached so it does not have to be recomputed subsequently as the specialization graph is traversed (or in subsequent inheritance computations).

As a result of these changes, the processing time for larger models can be reduced by half or more.

@seidewitz seidewitz self-assigned this Oct 10, 2024
@seidewitz seidewitz added this to the 2024-09 milestone Oct 10, 2024
- Added tests to verify redefinition behavior in diamond shaped
inheritance structures

 - Added test to verify redefinition behavior where the redefining
feature, rather than referencing the tail end of a chain of
redefinitions, references an element along the redefinition chain
@seidewitz seidewitz merged commit 4ff26c8 into master Oct 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants