Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1999

Improve performance/configuration options of ChainedProperties use in StatelessSession.execute calls

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    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

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            jeffja_jira Jeff Adams (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty