9 Replies Latest reply on Aug 21, 2008 8:05 PM by nbelaevski

    Stop parsing every page?

    bwobbones

      Hi,

      I've noticed that the filter runs a parser on *every* page in our application (using 3.1.6). We've tried everything we can think of to make it so this doesn't happen as it degrades the performance of our application by up to 30%.

      Does anyone know how to get around this and make the parsing only happen for pages that have a4j: or rich: tags? Is noone else having such catastropic performance issues with Richfaces?

      Greg

        • 1. Re: Stop parsing every page?
          ilya_shaikovsky

          developer guide
          chapter 5
          section 6

          "5.6. Filter Configuration"

          • 2. Re: Stop parsing every page?
            bwobbones

            Thanks for the reply!

            Yep - read it, tried every combination of the context params that I can think of, but it seems that most of the options relate to the parsing of the html after an AJAX request has been done.

            No matter what combination I use, NEKO or TIDY or NONE in whatever order, the FastHtmlParser is invoked for *every* page. Can anyone tell me why it's necessary for this to be done for pages that don't have any rich: or a4j: tags?

            • 3. Re: Stop parsing every page?
              ronanker

              Hi bwobbones,

              Have you tried to set to false the 'forceparser' parameter ?
              If yes have you notice changes ?

              By the way, how do you know that "the filter runs a parser on *every* page" ?


              • 4. Re: Stop parsing every page?
                bwobbones

                It's easy to see in the debug that the FastHtmlParser is run on every request, whether it's an AJAX request or a http request. I've been through the code trying (unsuccessfully) to prevent this behaviour for pages that don't have any rich: or a4j: tags (see my other post over in the dev forum).

                The forceparser init param does nothing to prevent this. Such a pain, it's really easy to get Richfaces running, but the performance makes it unuseable in an enterprise environment.

                • 5. Re: Stop parsing every page?
                  bwobbones
                  • 6. Re: Stop parsing every page?
                    ronanker

                    I don't really understand: what the 'forceparser' is for ?

                    In the doc it is said :

                    Force parsing by a filter HTML syntax checker on any JSF page. If "false", only Ajax responses are parsed to syntax check and conversion to well-formed XML. Setting to "false" improves performance, but can provide visual effects on Ajax updates
                    .

                    Is it a bug ? The jira you 're talking about is about a new parameter.
                    What will be the differences between 'forceparser' and this new one ?

                    I also got performance problem. Not with ajax requests (they are fast) but with regular http requests. Loading an entire page is a pain, especially during the render response phase and on the client side. The javascript initialisation seems very heavy too.



                    • 7. Re: Stop parsing every page?

                      Where you find the bug? In the doc quote?

                      • 8. Re: Stop parsing every page?
                        bwobbones

                        From what I can see in the code, the forceparser param is only used in the Tidy parser. I think that if don't have it set, tidy will only parse on AJAX requests and if you do it will parse for all requests. Otherwise, the FastHtmlParser is used. There's no getting away from parsing.

                        • 9. Re: Stop parsing every page?
                          nbelaevski

                          Not by Tidy only, please see in ConfigurableXMLFilter:

                          if (isAjax || isForcexml()) {
                           parser = parsers.getParser(viewId, mimetype);
                           } else {
                           parser = new FastHtmlParser();
                           }


                          isForcexml() == forceparser