I think that Sean worries about the overhead of n*1000 calls to fireAllRules, as
opposed to a single call. Also, a different heap usage/GC pattern
could impact timing.
A potential benefit of the second approach would be that results from
first firings are available sooner than with the 1st approach. But this
depends heavily on the time required for insertions and the overall
Drools usage scenario.
Simple benchmarking will tell.
Possibly a mid-way approach with fireAllRules every n insertions
might be a compromise.
-W
2010/7/28 Mauricio Salatino <salaboy(a)gmail.com>:
fireAllRules will only fire all the rules that where activated during
the
insertion phase. So basically when you call it at the end, it will only fire
all those rules activated. If you insert a fact that doesn't activate any
rule you don't need to call fire all rules.
On Tue, Jul 27, 2010 at 1:54 PM, sjoo822 <sean.joo(a)gmail.com> wrote:
>
> I have several thousand objects that gets inserted into a statefull
> knowledge
> session as show below:
>
> for (Item item : itemList)
> {
> session.insert(item);
> }
>
> session.fireAllRules();
>
>
> Assuming that all the conditions in the rules only concern with one item
> at
> a time, will there be a big performance difference if I changed the above
> to
> as shown below?
>
> for (Item item : itemList)
> {
> session.insert(item);
> session.fireAllRules();
> }
> --
> View this message in context:
>
http://drools-java-rules-engine.46999.n3.nabble.com/fireAllRules-performa...
> Sent from the Drools - User mailing list archive at
Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
--
- CTO @
http://www.plugtree.com
- MyJourney @
http://salaboy.wordpress.com
- Co-Founder @
http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users