Huge performance drop even with empty config

Splash Forums Rewrite Users Huge performance drop even with empty config

This topic contains 9 replies, has 4 voices, and was last updated by  gus.ehr 2 years, 6 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #24816

    djmj
    Participant

    I encounter a huge performance drop using //Rewrite.

    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.)

    Mojarra 2.1.23
    Glassfish 3.1.2

    Edit:

    Reverting back to PrettyFaces this performance drop does not occurs.

    #24817

    djmj
    Participant

    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>
    #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.

    #24839

    djmj
    Participant

    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.

    #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)?

    #25478

    djmj
    Participant

    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.

    #25480

    If you disable config reloading, and enable annotation scanning, the performance should only be affected on application startup. Can you confirm this?

    #25755

    gus.ehr
    Participant

    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.

    #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:

    https://github.com/ocpsoft/rewrite/issues/159

    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.

    Christian

    #25759

    gus.ehr
    Participant

    OK Christian!
    Thank you.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Comments are closed.