3 Replies Latest reply on Oct 10, 2009 4:11 PM by christoph.knecht

    performance issue when using ajax4jsf

      Hi! I'm trying to call a modal popup via ajax when the user clicks on an icon:

      <h:form>
      <h:graphicImage value="/img/myicon.gif" >
      <a:support action="#{myComponent.providePopupData('c1_3|2009-08-10')}"
      event="onclick"
      onsubmit="#{rich:component('waitpanel')}.show()"
      oncomplete="#{rich:component('waitpanel')}.hide(); #{rich:component('popup')}.show()"
      reRender="popup"
      bypassUpdates="true"
      limitToList="true"
      ajaxSingle="true"/>
      </h:graphicImage>
      </h:form>

      So far so good. That is this implementation works, but it works very slowly :-( The whole roundtrip requires about 500 ms, but when I time the action method 'providePopupData' it only consumes a few ms. So I'm looking for the bottleneck - any ideas?

      Thanks a lot in advance!!



        • 1. Re: performance issue when using ajax4jsf
          ilya_shaikovsky

          could you please paste the client side log from a4j:log component to pastebin.com?

          • 2. Re: performance issue when using ajax4jsf

            client-side log information can be found here:

            http://pastebin.com/m202bdd95

            Thanks!

            • 3. Re: performance issue when using ajax4jsf

              Additional infos:

              To monitor the time consumption on the server-side, I've implemented a JSF pase tracker which provides the following timings:

              21:26:12,419 INFO [STDOUT] Phase Tracker: Duration of RESTORE_VIEW 1: 109ms
              21:26:12,450 INFO [STDOUT] Phase Tracker: Duration of APPLY_REQUEST_VALUES 2: 0ms
              21:26:12,466 INFO [STDOUT] Phase Tracker: Duration of PROCESS_VALIDATIONS 3: 16ms
              21:26:12,731 INFO [STDOUT] Phase Tracker: Duration of RENDER_RESPONSE 6: 265ms

              Against the background of this measuring, I have embedded the above shown coding into a region component to shorten the render response time:

              <a:region renderRegionOnly="true"> ... </a:region>

              Indeed, this has a positive impact on the response time:

              21:24:07,669 INFO [STDOUT] Phase Tracker: Duration of RESTORE_VIEW 1: 125ms
              21:24:07,685 INFO [STDOUT] Phase Tracker: Duration of APPLY_REQUEST_VALUES 2: 0ms
              21:24:07,700 INFO [STDOUT] Phase Tracker: Duration of PROCESS_VALIDATIONS 3: 15ms
              21:24:07,747 INFO [STDOUT] Phase Tracker: Duration of RENDER_RESPONSE 6: 31ms

              But unfortunately this does not solve my problem yet: The measuring is only valid if I use the above shown component pattern only a few times on a page. But for whatever reason, my application uses this pattern umpteen times on the same page. And the response time increases linearly with the number of the region components. For 100 regions I get the following numbers:

              21:32:18,580 INFO [STDOUT] Phase Tracker: Duration of RESTORE_VIEW 1: 608ms
              21:32:18,611 INFO [STDOUT] Phase Tracker: Duration of APPLY_REQUEST_VALUES 2: 0ms
              21:32:18,611 INFO [STDOUT] Phase Tracker: Duration of PROCESS_VALIDATIONS 3: 0ms
              21:32:18,782 INFO [STDOUT] Phase Tracker: Duration of RENDER_RESPONSE 6: 171ms

              Is it possible to prevent from this correlation between response time and number of region components?

              Thanks!