[rules-users] Performance question - eval on a HashMap vs. from on an ArrayList

Michael Neale michael.neale at gmail.com
Thu Dec 11 04:01:20 EST 2008


If the number of items are small , its probably much of a muchness,  
and the difference would be hard to predict. The "from" kind of looks  
more declarative compared to the eval - its probably better.

Sent from my iPhone

On 11/12/2008, at 13:29, "steve.vance" <steve.vance at chromeriver.com>  
wrote:

>
> Hi, I'm somewhat new to drools and would like some comments on  
> performance.
>
> I'm choosing between doing an eval on a HashMap vs. a from on an  
> ArraryList.
> My assumption is the from on an ArrayList is better, is that  
> correct?  In my
> situation the HashMap and ArrayList do not have many items in them.
>
>
> thanks!
>
>
> 1. eval on HashMap
> when
>    $item:RulesVatTOA()
>    eval($item.getMyHashMap().get("Vat_YesNo") != null &&
> $item.getMyHashMap().get("Vat_YesNo").equals("Yes"))
> then
>
>
> 2. from on ArrayList
>  when
>    $item:RulesVatTOA()
>    $myValue:com.mycode.util.NameValue(name == "Vat_YesNo", value ==  
> "Yes")
> from $item.getMyArrayList()
>  then
>
>
> -- 
> View this message in context: http://www.nabble.com/Performance-question---eval-on-a-HashMap-vs.-from-on-an-ArrayList-tp20919533p20919533.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