Red Hat Bugzilla – Bug 1276311
Buildtime performance degradation in BR engine when building KieBase from dtables
Last modified: 2015-11-25 04:47:02 EST
The perceived performance degradation has been in reality caused by this fix https://github.com/droolsjbpm/drools/commit/dc81e1f1ca7f56a29b4fb6c0ad0e14bb3c49551c
Now when the compiler finds a complex constraint like the following (that is produced by one of the decision table in the benchmark)
"X".equals("MASTER") && "X".equals(qualifier) || "X".equals("CATCHALL") && qualifier.equals( "X") && catalogProductModel.getPchId() == null || qualifier.equals("X") && "X".equals("X")
it correctly analyses and eventually normalizes all the subexpressions in that constraint, something that didn't do at all before.
I tried to mitigate the performance impact of this further necessary checks with this commit https://github.com/droolsjbpm/drools/commit/0b935033f
I checked the effects of this last commit running the Walmart dtable 100 benchmark on my machine with the following results:
before the fix for BZ-1253575
693.183 ± 5.010 ms/op
after the fix but before this performance optimization
809.843 ± 2.854 ms/op
after the performance optimization
779.763 ± 5.744 ms/op
I also cherry-picked to 6.3.x this fix https://github.com/droolsjbpm/drools/commit/cc9a5eab6dc5e6e2a06ace59a3d0c8e0ce282b59 because investigating the issue reported in https://issues.jboss.org/browse/DROOLS-970 I've also found a way to further optimize the performances of the PatterBuilder.
After this fix I rerun the benchmark mentioned in the former comment obtaining the following result:
747.449 ± 3.265 ms/op
Verified in 6.2.0.CR1. There are improvements from 7% to 10 % against ER5 in dtables benchmarks that we have. I will publish CR1 performance report soon.