Details
-
Feature Request
-
Resolution: Done
-
Major
-
5.0.0.M5
Description
Profiling my use of drools using JProfiler, I am loading one RulesBase, and subsequently creating StatelessSessions to reuse by calling execute() multiple times.
JProfiler reported that my second biggest hotspot when calling StatelessSession.execute() 25k times was:
sun.misc.CompoundEnumeration.hasMoreElements 17,427 ms (18 %)
18.7% - 17,427 ms org.drools.util.ChainedProperties.loadProperties
18.7% - 17,427 ms org.drools.util.ChainedProperties.<init>
18.7% - 17,427 ms org.drools.util.ChainedProperties.<init>
18.7% - 17,427 ms org.drools.util.ChainedProperties.<init>
18.7% - 17,427 ms org.drools.SessionConfiguration.init
18.7% - 17,427 ms org.drools.SessionConfiguration.<init>
18.7% - 17,427 ms org.drools.reteoo.ReteooStatelessSession.newWorkingMemory
18.7% - 17,427 ms org.drools.reteoo.ReteooStatelessSession.execute
following this trace shows that every time StatelessSession.execute is called a new instance of
new ChainedProperties( "session.conf" ) is created on each newWorkingMemory...
But at least in my case, I don't really need to do all the work that new instance creation of of new ChainedProperties( "session.conf" ) does on each call, especially on every call to ReteooStatelessSession.execute.
I also didn't see an easy way of cleanly overriding this.
I did a test of just using an alternate version of SessionConfiguration that reused a shared instance of ChainedProperties and this still worked and saved me a majority of my execution time using these StatelessSessions.execute calls.
Should this use of ChainedProperties in StatelessSessions be optional, or at least their cardinality configurable?
Thanks
Jeff