Welcome to MSDN Blogs Sign in | Join | Help

Kavitak's WebLog

My space on the web...

Syndication

News

Kavita Kamani works at Microsoft. Everything here, though, is her personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.
Tuning the performance of your WF rules

Someone asked a question on the WF forum today about tuning the performance of his rules.

Basically the WF Rules Engine is single threaded and we dont expose any knobs for you to tweak the performance of the rules in WF V1. One way for you to improve the performance of your rules is by really thinking about the design of your rules.

One question to ask is - do I really need forward chaining? You can control whether or not by tweaking with the RuleChainingBehavior. Basically we will keep re-evaluating higher priority rules if actions of other lower priority rules actions updated the fields used in the high priority rule's condition - if you dont think that's going to change the results of your rule evaluation, you could yourself order and prioritize rules in a way that you explicitly disable chaining and optimise how your rule set runs.

One thing that can help you with your analysis is rules tracing - this is enabled by the following addition to your config file.

      <system.diagnostics>

            <switches>

                  <add name="System.Workflow.Activities.Rules" value="All" />

            </switches>

      </system.diagnostics>

 

Another way you can improve the performance is to write a custom PolicyActivity by deriving from it and then caching the RuleExecution and RuleValidation so that if the WF has other YourCustomPolicy activities which use the same RuleSet, then you can use the cached version and get better performance.

Published Monday, October 16, 2006 6:52 PM by kavitak

Filed under:

Comments

# Tuning WF Rules Performance @ Tuesday, October 17, 2006 1:34 AM

I posted this on my blog today after we saw a question about this on the WF MSDN forums. In future releases

The Connected Framework Rules Team Blog

# How to write a caching Policy Activity to improve the performance of your WF rules @ Tuesday, October 17, 2006 4:44 PM

To follow up on my post from yesterday on Tuning the performance of your WF Rules , here is some code

Kavitak's WebLog

Anonymous comments are disabled
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement  
Page view tracker