[rules-users] Drools 4 performs slower then Drools 3 - Help on .drlfile adaptation

Maxim Veksler maxim.veksler at gmail.com
Thu Nov 20 08:56:36 EST 2008


Hi Joe,

On Wed, Nov 19, 2008 at 8:16 PM, Joe White <Joe.White at recondotech.com>wrote:

>  Maxim,
>
> Depending on your use case you may be able to disable shadow facts in your
> Drools 4 instance. See the manual on when it is ok/not-ok to disable shadow
> facts. Based on your description it probably is acceptable for your uses.
> Disabling shadow facts may improve your performance, the manual has details.
>
>
>
> To disable shadow facts:
>
>   RuleBaseConfiguration conf = *new* RuleBaseConfiguration();
>
>                     conf.setShadowProxy(false);
>
>                     base = RuleBaseFactory.*newRuleBase*(conf);
>
>
>

Thank you for the tip, I've added the following flags :

        conf.setShadowProxy(false);
        conf.setAlphaMemory(false);
        conf.setIndexLeftBetaMemory(false);
        conf.setIndexRightBetaMemory(false);

and yet I'm seeing performance that are not near what I've been expecting,
am I doing something wrong or does drools gives me all that he can :

[maximv at mldev2 ~]$ awk -f awk_avg_ruleEngineFacade.getMatch.awk
/var/log/Manager.log
avg: 35.9153(ms) for 1027 calls


This is an example of the kind of rules we're using (modified) :

rule "Context OtherObject"
when
    $f : FilteringStateConnector($ContextId : ContextId, $subscriberId :
subscriberId)

    $subscriber : Subscriber(id == $subscriberId, $subscriberOtherObject :
OtherObject, OtherObject != null , OtherObject != "")
    $OtherObject : PropertyInstance(type_ ==
PropertyInstance.OtherObject_PROPERTY_TYPE, code ==
$subscriberOtherObject)
    $Context : Context(code == $ContextId, OtherObjects contains
$OtherObject)

then
    $f.setPassedRuleRecord("Context OtherObject");
end



>  *From:* rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] *On Behalf Of *Maxim Veksler
> *Sent:* Wednesday, November 19, 2008 8:36 AM
> *To:* Rules Users List
> *Subject:* [rules-users] Drools 4 performs slower then Drools 3 - Help on
> .drlfile adaptation
>
>
>
> Hello everyone,
>
>
> Please allow me to briefly describe how our system works:
>
> We use drools as an efficient matching layers - I have X rules, in the RHS
> of each rule I have a mark for each rule to signal that it has passed in the
> current context (There are by definition more then 1 contexts). After the
> first fireAllRules() has finished, and I have the data structure that allows
> me to query what rules have passed for each context I assert a "Marker"
> object, that allows Drools to continue filtering only for these contexts
> that I decide as valid to match attempts.
>
> The end result, is that I have 2 fireAllRules called with some java code in
> between them.
>
>
> In drools3 for 3 contexts I got the following resutls :
>
> == Drools Section (Generic Call) : With default context settings, no
> HotSpot.
> RESULT::::::::    avg: 33.9023(ms) for 1555 calls
>
> Now in drools4 I'm getting the following:
>
> == Drools Section (Generic Call) : With default context settings, no
> HotSpot - Drools 4
> RESULT::::::::    avg: 37.4356(ms) for 1467 calls
>
>
>
> As I increase the context's number I'm getting larger difference in results
> time.
> Please note that HotSpot is disabled just for the test, to not JIT
> interference.
>
> I've disabled all evals in the drl files, to all is left is pure Drools
> syntax and yet It seems that the system works slower.
>
> Please suggest what else I should be doing to optimize the drl files to
> work efficiently with Drools 4 engine.
>
>
> Thank you,
> Maxim.
>
> --
> Cheers,
> Maxim Veksler
>
> "Free as in Freedom" - Do u GNU ?
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20081120/f5af1aee/attachment.html 


More information about the rules-users mailing list