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

steve.vance steve.vance at chromeriver.com
Wed Dec 10 21:29:08 EST 2008


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.




More information about the rules-users mailing list