Setting Priorities on Item Filter Rules

I came across this problem with a customer’s publishing performance and wanted to share. This would affect anyone on 6.7->7.x that is using custom item filter rules.

Item Filter Rule extensions can be used to filter content in a content list. The order that these are executed in can have an effect on publishing performance, but the order in the workbench is not always used for this.

Because most Item Filter Rule extensions are based on the com.percussion.services.filter.impl.PSBaseFilter extension base class, they all have a Priority property that can be used to control the order that the Rules are executed in. In general system item filters should be executed before custom item filters.

To fix this, you need specify the priority for each rule.

In Workbench on the System->Extensions->Item Filter Rules list. Add the following parameter to each extension.

Name: com.percussion.services.filter.priority
Type: java.lang.String
Description: Filter Priority.

Then in Workbench on the Assembly->Item Filters list. Edit each Item Filter and set the value of the com.percussion.services.filter.priority to a numeric value. Rules with the Highest value will be run before rules with the lower value.

For example, a “staging” item filter would have the rules in the following priority:

sys_filterByFolderPaths priority 10
sys_filterByPublishableFlag priority 5
PSOStagingRevisionFilter priority 1

This can speed things up dramatically because custom code in Rules can be slow, and the smaller the data set that they are operating on the better. The reason things go quicker in this instance, is because say a content list has 40,000 items in it. Then gets filtered to only items in a given folder, cutting the size down to 1,000, then gets filtered to only publishable items, filtering it down to 300. When we get to the last filter, it will execute on only 300 items - instead of the 40,000.

The performance gains can be big enough that it is worth double checking your publishing configuration.

-n