[rules-dev] Final take on performance .

Geoffrey De Smet ge0ffrey.spam at gmail.com
Mon Aug 18 13:16:29 EDT 2008


1) First run your benchmark for at least a minute, before resetting it 
and starting the time counter:
- drl's are probably compiled to java at runtime
- hotspot compiling takes a minute to warm up (in -server mode at least)
- java has a dog slow initialization phase, but it's the fastest 
language on the planet once it's warmed up.

2) Your benchmark should at least run 10 minutes, anything less can 
easily be affected by background tasks

3) After the first benchmark, double your data and check how much longer 
it takes: that's your scalability.
Which program is better?
- program A: 10K rows give 10s and 20K rows give 40s
- program B: 10K rows give 25s and 20K rows give 50s
Program B is better if you speed limit is 100s,
because 40K rows will only take 100s on B (do the math yourself for 
program A).

4) It's not about if and else, it's about nesting for/while loops.
Take some use cases where you need to nest for/while loops to be able to 
implement your rules, then you 'll see a much better Big0 notation for 
the rule engine (= much better scalability).
http://en.wikipedia.org/wiki/Big_O_notation

With kind regards,
Geoffrey De Smet


Harsh Jetly schreef:
> Hi ,
> I have been given an assignment to show case the situation where the
> performance of a rule engine will be better than java code .
> 
> My first question is ; Is this possible ?
> 
> What I had done earlier was I sent an arraylist and I used the 'from'
> clause , like Mark pointed out for the 'from' statement pure iteration
> happens and the index is not created .
> 
> So what I have done now  is create a scenario where I insert about 20,000
> objects and have 20 rules (each rule has 2 alpha nodes ) . I do the same
> with java code (if-elses) and the java code wins this competition hands
> down .
> 
> Is there a breakthrough point where the rule engine performs as well as the
> java code or even better ?
> 
> 
> Appreciate it
> 
> Harsh
> 
> 
> ______________________________________________________________________
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
> 




More information about the rules-dev mailing list