I've observed a sizable (25%) performance degradation between the 5.0.1 and 5.1.0 releases. I've attached a sample project that tests the performance of matching nested objects. (ANd compares direct reference matching and the performance pitfalls of "from," but that's beside the current point.)
If you switch the pom.xml from using 5.0.1 to 5.1.0 for the drools dependencies you'll see 25% longer execution times on the tests. (mvn test)
Here's the test output:
5.0.1
reference.drl Count: 2000 reference.drl Time: 267ms reference.drl Time per element: 0.1335ms BAR Duplicates: 780 FOO Duplicates: 880
reference.drl Count: 20000 reference.drl Time: 1249ms reference.drl Time
per element: 0.06245ms BAR Duplicates: 7702 FOO Duplicates: 8040
from.drl Count: 200 from.drl Time: 1139ms from.drl Time per element: 5.695ms BAR Duplicates: 112
FOO Duplicates: 102
reference.drl Count: 200 reference.drl Time: 5ms reference.drl Time per element: 0.025ms BAR Duplicates: 86 FOO Duplicates: 60
5.1.0
reference.drl Count: 2000 reference.drl Time: 300ms reference.drl Time per element: 0.15ms BAR Duplicates: 788
FOO Duplicates: 820
reference.drl Count: 20000 reference.drl Time: 1564ms reference.drl Time per element: 0.0782ms BAR Duplicates: 8142 FOO Duplicates: 7960
from.drl Count:
200 from.drl Time: 3543ms from.drl Time per element: 17.715ms BAR Duplicates: 68 FOO Duplicates: 90
reference.drl Count: 200 reference.drl Time: 13ms
reference.drl Time per element: 0.065ms BAR Duplicates: 84 FOO Duplicates: 74
On the most taxing test (20k objects) 5.0.1 took 1249ms while 5.1.0 took 1564ms, and for larger tests the effect is more pronounced. This is primarily a test of == on object references.
GreG |