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

chore: unify the handling of list variable shadows #1228

Merged
merged 18 commits into from
Nov 28, 2024
Merged

Conversation

triceo
Copy link
Contributor

@triceo triceo commented Nov 27, 2024

All shadow variables related to a list variable are now handled in one unified loop, as opposed to each having its own variable listener.
This should technically be a performance improvement, but in fact a barely significant regression of 3 % was measured in some cases. (Other cases show minor improvements.)

This change also makes internalized previous/next shadows possible, and that in turn will help with the revamp of shadow variables that is currently in development.
Therefore we introduce this change even though it may bring a small performance regression.

@triceo triceo marked this pull request as ready for review November 28, 2024 17:43
@triceo triceo self-assigned this Nov 28, 2024
@triceo
Copy link
Contributor Author

triceo commented Nov 28, 2024

@Christopher-Chianelli Since you're going to be using this later, would you mind reviewing?

Copy link
Contributor

@Christopher-Chianelli Christopher-Chianelli left a comment

Choose a reason for hiding this comment

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

LGTM; possible performance improvements:

  • Merge NextElementVariableProcessor and PrevElementVariableProcessor into a single, final class, and add a private final int field that +1 for NextElementProcessor, and -1 for PrevElementProcessor.
  • Do not call getInverseSingleton and getIndex in getLocationInList, since they both do a map lookup on the same element.

@triceo triceo merged commit ee760ca into TimefoldAI:main Nov 28, 2024
27 of 28 checks passed
@triceo triceo deleted the perf branch November 28, 2024 20:03
@triceo triceo added this to the 1.17.0 milestone Nov 28, 2024
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