Description
After moving to the 4.0.3 version we are taked notice of application performance degradation in comarisopn with 4.0.2. Aftert application profiling we found that most time of page loading takes our permission resolving system based on drools. For each permission request application creates new statefull session (we use statefull because facts needs a possibility to be dynamical) and after asserting some facts issued fireAllRules. Further application profiling lead us to the Objenesis calls. The creation of Objenesis's instantiator is a very slow operation and the results of instantiators creating was cached only during the working memorry life cycle (which is very short in our app). So its seems reasonlibe to turn on Objenesis cache, and move Objenesis instance to the RuleBase level to avoid memory leaks. The attached patch working for me and after applying our app working up to ten times faster.