[rules-users] Bulk-Retract speed conundrum

Wolfgang Laun wolfgang.laun at gmail.com
Fri May 7 04:58:16 EDT 2010


You can insert any string into a template, and so the formal template parameter
could be the entire condition.

So, depending on CODE_LOW == CODE_HIGH, produce "code == CODE_LOW";
otherwise produce "code >= CODE_LOW && <= CODE_HIGH" as the
actual template parameter.

I'm far from an Excel expert, but I guess it can't be too difficult to
prepare that
string value in another column, based on the other two.

I'd also investigate possibilities of speeding up
Utilities.isWithinTimePeriod. Dates
can easily be converted to int or long, seconds after the Epoch. Then, compares
are much faster, earning returns for the conversion effort.

-W


On Fri, May 7, 2010 at 10:21 AM, djb <dbrownell83 at hotmail.com> wrote:
>
> Hi Edson, Wolfgang,
>
> Sorry, I don't think my previous mail posted, sorry if it did.
>
> Thanks for your suggestions.  They were very helpful, and I managed to drop
> it down to 130ms, and I can see that if I get Wolfgang's suggestion right,
> it will jump down to under 80!
>
> The changes I made, which decreased run time by 200ms were:
>
> -The superfluous last condition (with the collect(...)) is only relevant
> when the variable is non-zero, so I've changed the values in the rule
> template from 0 to blank, and used the commenting trick to blank out those
> lines when the condition is irrelevant.
>
> -Putting the check for type before the check for code.
>
> -The inline eval did not improve speed, in fact, it decreased the speed
> slightly.
>
> -disposing the session instead of retracting
>
> ... and now I am looking for a way to conditionally show the =>/=< vs. ==
> when it is appropriate.  It does not appear that there is an easy way to do
> this, with rule templates.
>
>
> regards,
> Daniel
> --
> View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Bulk-Retract-speed-conundrum-tp779188p783188.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>




More information about the rules-users mailing list