1 2 Previous Next 19 Replies Latest reply on May 6, 2010 2:57 AM by ilya_shaikovsky

    Richfaces menu rendering is slow

      Hello,
      I am using rich:dropDownMenu component to render a dropdown menu. When tested in IE 6 this menu takes lot of time(10 secs) to render. The menu contains around 100-150 menu items. Also mouse over the top menu items is slow. It takes 5 secs for the drop down menu to appear. I have set the showDelay to minimum value. This problem is noticed substantially in IE 6, whereas in IE 7 this is comparatively faster.

      I have pasted the xhtml code for your reference. The tool bar component has drop down menu as child components.

      <rich:toolBar height="25" binding="#{menuRendererBean.menuBar}">
       <f:facet id="sepFacet" name="itemSeparator">
       <rich:separator id="itemSep" width="2" height="12" />
       </f:facet>
      </rich:toolBar>
      


      Any suggestion to improve the menu performance?

      Thanks,
      Zafer

        • 1. Re: Richfaces menu rendering is slow
          ilya_shaikovsky

          at first we could suggest to try latest 3.3.2 snapshots to compare. huge perfomance tunning work was done in general and for menu also.

          • 2. Re: Richfaces menu rendering is slow

            I am facing this issue when using 3.3.2 snapshot version. I could find most of the performance related issues and IE 6 issues are resolved in this version but for the above mentioned issue.

            • 3. Re: Richfaces menu rendering is slow
              ilya_shaikovsky

              yes, seems 100-150 items is too much for IE 6.. :) Probably we could revise this one more time. please cerate jira request with your sample on this. But need to inform you that we are almost ready for 3.3.2 GA and this will be adressed to next versions only.

              • 4. Re: Richfaces menu rendering is slow

                Hi,

                 

                I am using Richfaces 3.3.2 ith IE8 and I am still seeing a slow rendering time with the dropDownMenu.

                 

                Is there a maximum number of menuItems?

                 

                My base menu has around 2000 items in it.  It will render but takes about 10-15 seconds.

                 

                Is there anything I can do to speed this up?

                 

                I use the tree component as well and I changed the switchType to ajax and that works fine.

                 

                Does the dropDownMenu have a similiar attribute?

                 

                Thanks

                • 5. Re: Richfaces menu rendering is slow
                  nbelaevski

                  Hi Billy,

                   

                  There's no similar feature for menu.

                  • 6. Re: Richfaces menu rendering is slow

                    Is there anything I can do to speed up the render time for this?

                     

                    Does anyone have any other suggestions?

                    • 7. Re: Richfaces menu rendering is slow
                      nbelaevski

                      Try adding PhaseTracker and check how much time is spent on the server on rendering phase. This will provide information whether the slowdown is caused by server-side or client-side operations.

                      • 8. Re: Richfaces menu rendering is slow

                        Hey Nick,

                         

                        Thanks for the response.  I have a phase logger on the page now.  I have a button I click to go to the menu page.

                        I added a couple System.out messages for the various functions that run on server side.  As you can see the server side takes less than 1 second.

                        The 10-15 seconds of wait time occur after the last line.  Not sure what I can do.  Any suggestions are appreciated.

                         

                        [4/23/10 14:56:40:533 MST] 00000023 SystemOut O [2010-04-23 14:56:40,533] DEBUG JsfPhaseLogger.beforePhase: RESTORE_VIEW 1

                        [4/23/10 14:56:40:533 MST] 00000023 SystemOut O [2010-04-23 14:56:40,533] DEBUG JsfPhaseLogger.afterPhase: RESTORE_VIEW 1

                        [4/23/10 14:56:40:533 MST] 00000023 SystemOut O [2010-04-23 14:56:40,533] DEBUG JsfPhaseLogger.beforePhase: APPLY_REQUEST_VALUES 2

                        [4/23/10 14:56:40:533 MST] 00000023 SystemOut O ----- begin getTreeNode -----

                        [4/23/10 14:56:40:533 MST] 00000023 SystemOut O ----- end getTreeNode -----

                        [4/23/10 14:56:40:533 MST] 00000023 SystemOut O ----- begin makeRoot -----

                        [4/23/10 14:56:40:611 MST] 00000023 SystemOut O ----- end makeRoot -----

                        [4/23/10 14:56:40:627 MST] 00000023 SystemOut O [2010-04-23 14:56:40,627] DEBUG JsfPhaseLogger.afterPhase: APPLY_REQUEST_VALUES 2

                        [4/23/10 14:56:40:627 MST] 00000023 SystemOut O [2010-04-23 14:56:40,627] DEBUG JsfPhaseLogger.beforePhase: RENDER_RESPONSE 6

                        [4/23/10 14:56:40:627 MST] 00000023 SystemOut O ---------- begin getDisplayMenu ----------

                        [4/23/10 14:56:40:627 MST] 00000023 SystemOut O ---------- begin getMenuRootsforMenu ----------

                        [4/23/10 14:56:40:627 MST] 00000023 SystemOut O ---------- begin getMenuItems ----------

                        [4/23/10 14:56:40:876 MST] 00000023 SystemOut O ---------- end getMenuItems ----------

                        [4/23/10 14:56:40:876 MST] 00000023 SystemOut O ---------- begin getAllMenuItems ----------

                        [4/23/10 14:56:41:219 MST] 00000023 SystemOut O ---------- end getAllMenuItems ----------

                        [4/23/10 14:56:41:235 MST] 00000023 SystemOut O ---------- end getMenuRootsforMenu ----------

                        [4/23/10 14:56:41:235 MST] 00000023 SystemOut O ---------- end getDisplayMenu ----------

                        [4/23/10 14:56:41:469 MST] 00000023 SystemOut O [2010-04-23 14:56:41,469] DEBUG JsfPhaseLogger.afterPhase: RENDER_RESPONSE 6

                        • 9. Re: Richfaces menu rendering is slow

                          Has anyone else tried using the drop down menu with 2000+ menu items?

                          • 10. Re: Richfaces menu rendering is slow

                            Is it possible to get an example of a dropdown menu that uses ajax onClick event?

                             

                            I'd like to display the children of the clicked parent.

                             

                            Thanks

                            • 11. Re: Richfaces menu rendering is slow
                              ilya_shaikovsky

                              menu could be shown on onclick event. But it will be still client side operation. Menu has no ajax fetching mode. And it's really strange case for dropdown menu when the user just expects the menu to appear and see some loading for every hover/click. So it was not designed.

                              • 12. Re: Richfaces menu rendering is slow

                                Ilya ,

                                 

                                Thanks for the reply.  Our menu has close to 2000 items in it and it takes so long for the page to render.  That is the only reason I was thinking about making the root level menu items an ajax call.  Could you help me with this?  I am having trouble getting it to work.

                                 

                                Thank you

                                • 13. Re: Richfaces menu rendering is slow
                                  ilya_shaikovsky

                                  load menu only when user clicking to call it poss sible to implement only with contextMenu. Two problems there:

                                  • It has different positioning mechanism. So will slightly differs from dropdown
                                  • it will not solve the problem fully as 2000 items loaded via ajax will also works slowly after rendered.

                                   

                                  B.t.w. just interested - what is your use-case? Just trying to think about some other workaround.

                                   

                                  b.t.w. - https://jira.jboss.org/jira/browse/RF-8637 created for 4.x

                                  • 14. Re: Richfaces menu rendering is slow

                                    Thanks again for getting back to me.

                                     

                                    Our company has 30 or so applications for accounting purposes and under each application menu we have about 50-100 options broken into subgroups.  When all 30 apps need to be loaded the dropdownmenu hangs.  I am trying to write some code now to show the 30 options and on click then the menu is created and returned via ajax just for that option.  I am not sure what else I can do.  The rich dropdownmenu looks great when it finally loads.

                                    1 2 Previous Next