performance: rule set or triggered rules? I need to create some rules like "when create photo, when create video, when create story" but all use the same Event "after content is saved"...

so, what's the best way? a rule that trigger a rule set with various rules or varios indepedent triggered rules?

i.e:

RULE SET

rule (when create content) &gt;
    event (after content is saved) &gt;
        set (set: when create content) &gt;
            rule (when create photo) &gt;
                if:
                do:
                    rule (when create video) &gt;
                        if:
                        do:
                    rule (when create story) &gt;
                        if:
                        do:
                    rule (when create page) &gt;
                        if:
                        do:
                    rule (when create product) &gt;
                        if:
                        do:


total:

1 set
6 rules
1 event


TRIGGERED RULES

Rule (when create photo) &gt;
    Event (after content is saved) &gt;
        if:
        do:

Rule (when create video) &gt;
    Event (after content is saved) &gt;
        if:
        do:

Rule (when create story) &gt;
    Event (after content is saved) &gt;
        if:
        do:

Rule (when create page) &gt;
    Event (after content is saved) &gt;
        if:
        do:

Rule (when create product) &gt;
    Event (after content is saved) &gt;
        if:
        do:


total:

5 rules
5 events


thanks.
I believe the performance different is marginal, so I would chose the most maintainable.

Anyways in regards to performance my bet would be on the last option. Events function pretty much like a SQL where clause, so having more events doesn't hurt performance in itself. The number of rules that has to be fetched from the database, and initialized does effect performance, along with the number of queries that need to be executed.

So Rules will (most like) in the first case be running two queries. One to get the rule set based in the event and one to get the 5 rules in the set. It will need to instantiate 6 rules classes.

In the second case, rules will run a sigle query and only need to instantiate 5 rules classes.

So with fewer queries and rules classes that need to be instantiated the last version should be the most performance optimized. I doubt that you actually will be able to measure this though.