Huge performance drop even with empty config
September 5, 2013 at 6:05 pm #24816
I encounter a huge performance drop using
On my local machine the site needs to render from 250ms (without rewrite) to around 6 seconds!.
(Reloaded site multiple times for startup issues like cache.)
At first I removed all of my rules to have an empty configuration. Still same low performance.
Then I deleted my configuration class completely and I am back to my “fast” 250ms.
Note: Application was clean deployed (cleared server cache and so on.)
Reverting back to
PrettyFacesthis performance drop does not occurs.September 5, 2013 at 6:30 pm #24817
Ah I forgot to set the reloading flag in the web.xml to false.
<context-param> <param-name>org.ocpsoft.rewrite.config.CONFIG_RELOADING</param-name> <param-value>false</param-value> </context-param>September 6, 2013 at 4:06 am #24818
So you say this performance problem disappears as soon as you disable config reloading?
Hmmm. Although this fixes the problem, I’m very surprised by this huge performance problem. I wonder what exactly is causing this. One possible candidate would be the annotation scanning. But I sent quite some time of my life on optimizing this scanning process. 🙂
Could you perhaps try to enable configuration reloading again but additionally disable the annotation scanning by setting this parameter:
<context-param> <param-name>org.ocpsoft.rewrite.annotation.BASE_PACKAGES</param-name> <param-value>none</param-value> </context-param>
This allows me to verify if the annotation scanning is or is not the source of the performance drop.September 8, 2013 at 9:06 am #24839
Annotation scanning seems to be the source of the performance drop.
I enabled config reloading and disabled scanning:
<context-param> <param-name>org.ocpsoft.rewrite.config.CONFIG_RELOADING</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.ocpsoft.rewrite.annotation.BASE_PACKAGES</param-name> <param-value>none</param-value> </context-param>
which leads to “good” performance.September 8, 2013 at 11:21 am #24841
Hmmm. Thanks for giving this configuration a try. Anything special about your environment that could cause this?
Could you perhaps tell be a few more details? Is it a very large app with many classes? Which OS are you using? Do you deploy a WAR or an EAR archive? Anything that could slow down access to the HDD (like a NAS or something like that)?December 3, 2013 at 6:33 pm #25478
Sorry for late answer. The base WAR I deploy has around 50 classes. One shared library around 50, and another 100.
So basically around 200 classes.December 3, 2013 at 11:30 pm #25480
Lincoln Baxter IIIKeymaster
If you disable config reloading, and enable annotation scanning, the performance should only be affected on application startup. Can you confirm this?January 14, 2014 at 2:15 pm #25755
I have noted a startup performance improvement with that configuration.
Disable config reloading and define a base package for annotation scanning.
Where can I find the list of context parameters of rewrite?
Can I setup the rewrite by a single file?
Thanks in advance.January 15, 2014 at 2:19 am #25757
I think there is currently no complete list of parameters. But I guess we really need to add this to the documentation. I created an issue for that:
What do you mean with “Can I setup the rewrite by a single file?”. You could use a ConfigurationProvider instead of annotations to configure Rewrite if you want to have your configuration at a single place.
ChristianJanuary 15, 2014 at 6:39 am #25759
You must be logged in to reply to this topic.