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

Simplify and optimize workflow instance creation. #6281

Merged
merged 6 commits into from
Jan 10, 2025

Conversation

sfmskywalker
Copy link
Member

@sfmskywalker sfmskywalker commented Jan 9, 2025

  • Replaced asynchronous instance creation methods with streamlined synchronous alternatives where applicable.

  • Introduced CreateAndCommitWorkflowInstanceAsync for combined instantiation and persistence, along with a separate CreateWorkflowInstance method for non-committal instantiation.

  • Refactored related code to improve readability, maintainability, and runtime performance.


This change is Reviewable

Replaced explicit type initializations with concise target-typed `new()` expressions where applicable, improving code readability and aligning with updated C# conventions. Updated .editorconfig to enforce consistent use of `var` for type declarations.
Replaced asynchronous instance creation methods with streamlined synchronous alternatives where applicable. Introduced `CreateAndCommitWorkflowInstanceAsync` for combined instantiation and persistence, along with a separate `CreateWorkflowInstance` method for non-committal instantiation. Refactored related code to improve readability, maintainability, and runtime performance.
Replaced `default` with explicit `null` for optional parameters to improve clarity and readability. Additionally, simplified object initialization by leveraging newer C# features like target-typed `new`.
Extract shared workflow graph retrieval logic into a new `GetWorkflowGraphAsync` method, reducing code duplication. Updated call sites to use the new method for better maintainability and readability.
Replaced absolute expiration with sliding expiration for cache entries to ensure the cache is kept active during frequent access. This change optimizes cache behavior and improves resource utilization.
Enabled CachingOptions configuration and set a 1-day cache duration while disabling the use of secrets. These changes improve caching behavior and streamline application setup by avoiding secret dependencies.
@sfmskywalker sfmskywalker merged commit ca4953d into main Jan 10, 2025
2 of 3 checks passed
@sfmskywalker sfmskywalker deleted the perf/local-runtime-perf-degradation branch January 10, 2025 09:11
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