12 Replies Latest reply on Apr 15, 2009 11:11 PM by joblini

    Size of HTML produced

    joblini

      Hello,

      First, please allow me to thank you for the great work you have been doing with Richfaces. I have been using RF in a project for nearly a year.

      As our project advances, we are running into problems with the size of pages containing certain RF components.

      For example, a recently developed page, which contains a rich:table with 50 rows and and 20 columns, generates over 600K of markup.

      The following three items alone account for 50% of the page size:

      60K for the RichDataTable (compared to h:datatable)
      60K is the rich:menu (about 40 items in all)
      200K for one column, which contains a rich:comboBox (with only 5 values)

      The original page was even bigger, because it also used rich:tooltip. I had to replace the rich:tooltip with a jQuery based component.

      Do you think that reducing the size of generated markup could be a priority for the next major release of Richfaces?

      Thanks for any guidance you may be able to provide.

        • 1. Re: Size of HTML produced
          jbalunas

          Hi Joblini,

          I think an overall review of the markup and JS size is a good idea for the next major release of RichFaces. This would be RichFaces 4.0.

          Could you create a jira with this information in it?

          Thanks,
          Jay

          • 2. Re: Size of HTML produced
            joblini

             

            "jbalunas@redhat.com" wrote:
            Hi Joblini,

            I think an overall review of the markup and JS size is a good idea for the next major release of RichFaces. This would be RichFaces 4.0.

            Could you create a jira with this information in it?

            Thanks,
            Jay


            Thanks for the quick reply, I have opened https://jira.jboss.org/jira/browse/RF-6485

            • 3. Re: Size of HTML produced
              jbalunas

              Excellent thanks!

              • 4. Re: Size of HTML produced

                changing the components layout will brake immediately the backward compatibility with all applications that use RichFaces already.
                Optimizing the rendering output is one of the target for RichFaces 4.0

                The size of the component (like rich:dataTable from < table > to < /table> is not only result of the dataTable rendering by itself, but also the size of the components included into the table). The different between the h:dataTable and rich:dataTable are skinning css lasses only. However, if you add the Ajax behavior to columns, the size for both h:dataTable and rich:dataTable will be increased drastically.
                The most common developers' mistake is defining the instance of rich:menu for each row of the table instead of sharing the single instance between the rows.

                • 5. Re: Size of HTML produced
                  joblini

                   

                  "SergeySmirnov" wrote:
                  The most common developers' mistake is defining the instance of rich:menu for each row of the table instead of sharing the single instance between the rows.


                  Sorry, just to be clear the rich:menu is not included in the table, it is just a regular menu at the top of the page. It does contribute 60K to the total size, though.

                  It would be great to be able to share a single instance of rich:combobox between the rows, since each instance is around 4K. AFAIK, this is not currently possible.



                  • 6. Re: Size of HTML produced

                    Yes, where I work we have the same problems, it is becoming increasingly hard to compete with other teams doing their development with Seam Web Remoting (or DWR) + JScriptBasedWidgets, because they seem to need a lot less bandwith (no need to transmit the UI markup, they just transmit the data, and build the UI in the client)

                    • 7. Re: Size of HTML produced
                      jbalunas

                      We will review what can be done for the 3.3.2 timeframe, but likely significant improvements on this will not be possible until RF 4.0 because of backwards compatibility concerns.

                      Please vote for this issue in Jira if you have not already.

                      Thanks,
                      Jay

                      • 8. Re: Size of HTML produced
                        joblini

                        Hi Jay,

                        Thanks for your support on this issue. Any improvements that could be included in 3.2.2 would be welcome!

                        Our client is raking us over the coals because of the size of the pages, and the resulting response times :-(

                        One thing that helped was enabling GZIP in Jboss/Tomcat.

                        Best regards,
                        Ingo

                        • 9. Re: Size of HTML produced
                          joblini

                          Sorry, meant to say 3.3.2, not 3.2.2

                          • 10. Re: Size of HTML produced
                            ilya_shaikovsky

                            b.t.w. some important work on performance and memory was already done for 3.3.1 and currently available in BETAs. So you could freely update your RF version. It has the same environment dependencies as 3.2.2.

                            • 11. Re: Size of HTML produced
                              jpleed3

                              Perhaps adding a colgroup to the table would reduce the need to set classes on every single cell. Either that or some kind of tag attribute to render the table leaner.

                              For a 50x20 table, just removing 'class="dr-table-cell rich-table-cell " ' would save 38K from the page size.

                              • 12. Re: Size of HTML produced
                                joblini

                                 

                                "jpleed3" wrote:
                                For a 50x20 table, just removing 'class="dr-table-cell rich-table-cell " ' would save 38K from the page size.


                                Yes, wouldn't it be sufficient to define a single class at the table level?

                                <table class="rich-table">


                                CSS could then use the selector:

                                table.rich-table td {
                                
                                }