Added option to disable auto type registry#501
Merged
Conversation
- removed caching from RuleExpressionParser
3 tasks
YogeshPraj
added a commit
that referenced
this pull request
May 27, 2026
#727) The static MemCache around Compile<T> was removed in v5.0.1 (#501) along with the AutoRegisterInputType feature. Removing it caused every call to Compile<T> / CompileRuleExpressionParameters to re-run the dynamic expression parser and re-emit IL, causing ~10x slowdowns reported in #673 and 100x-1900x slowdowns on the public parser and ExecuteActionWorkflowAsync paths that are not served by the workflow-level RulesCache. Reintroduce the cache as an instance field (not static, to avoid the latent cross-settings sharing bug the old static had). The key includes the expression text, ordered (paramName, paramType), return type, and a settings fingerprint covering IsExpressionCaseSensitive, UseFastExpressionCompiler, and CustomTypes. Scoped-params keys also include each value-expression's text so workflow mutations correctly invalidate. Honors the existing ReSettings.CacheConfig; SizeLimit == 0 disables. Benchmark (median of 5 runs, .NET 8, 30-rule workflow): Parser.Evaluate<bool> x 30k: 34,730 ms -> 33 ms (~1052x) Parser.Compile<bool> x 30k: 34,846 ms -> 18 ms (~1936x) ExecuteActionWorkflowAsync x 1000: 1,182 ms -> 3 ms ( ~394x) ExecuteAllRulesAsync x 1000 (warm): 11 ms -> 17 ms (within noise) Fresh engine x 50: 1,890 ms -> 1,867 ms (unchanged) Co-authored-by: Yogesh Prajapati <yogeshcprajapati@outlook.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #500