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

Avoid rebuilding combinator reset delegate #1750

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

glopesdev
Copy link
Member

Operator properties can sometimes represent shared state which is meant to be assigned and used only at runtime, and which needs to be explicitly invalidated in between workflow execution (see #1083).

Such operators can use the ResetCombinatorAttribute to indicate they want any non-serializable properties (i.e. properties marked with the XmlIgnoreAttribute) to be reset to their default values on every build. Currently this is implemented as a delegate which is emitted at build time for every resettable operator. However, since the delegate logic depends only on the combinator type, it would be possible to cache the emitted delegates to avoid re-emitting delegates for multiple uses of the same operator.

This PR introduces a nested generic type to serve as the cache, which should speed up build times in workflows with large numbers of resettable operators.

@glopesdev glopesdev added the proposal Request for a new feature label Apr 22, 2024
@glopesdev glopesdev added this to the 2.8.3 milestone Apr 22, 2024
@glopesdev glopesdev merged commit 9357b9e into bonsai-rx:main Apr 23, 2024
3 checks passed
@glopesdev glopesdev deleted the cache-reset-combinator branch April 23, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Request for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant