tags:

views:

183

answers:

1

Hello

I'm using a RichFaces <rich:insert like this:

<rich:panel header="my head">
    <a4j:outputPanel ajaxRendered="true">
        <rich:insert src="#{MyBacking.myPath}" highlight="groovy" />
    </a4j:outputPanel>
</rich:panel>

If I have a 60k file to output, it takes 23 seconds. I've got a requirement to output the contents of some larger files than that and obviously the larger the file, the larger the wait for content. The recommendation in the answer to another related question is to introduce paging. I will, but the question is, why does it take so long to output 60k of text using JSF/RichFaces? That is, reading off a local disk with Windows XP SP2 PC - I can see from the log the data has already been written to disk from the network.

Other scripting languages appear to be faster than this - is it something to do with the JSF lifecycle having to handle the text maybe?

Thanks

A: 

If it is a text file (and not binary), and you don't need syntax highlighting, why don't you include it with <a4j:include>?

If you really need syntax highlighting, then you could try to:

  • upgrade to the latest version of richfaces
  • verify whether the slowness isn't coming from the javascript engine of your browser
  • use other syntax highligher, like markdown
Bozho
I tried that. Worked fine except the file didn't have html break tags in. When I put them in, it ran dog slow again.
Mark Lewis
@Mark Lewis which one of the 4 options I suggested did you try? :)
Bozho
@Bozho: I tried the `a4j:include` tag instead - (see previous comment). I'm using the latest version of RF. Checking the javascript engine is interesting, but I'm using the latest FF so not expecting this. I don't need highlighting - it's performance that's important. I've used an iframe solution which works.
Mark Lewis
@Mark Lewis - ok. I didn't get the comment about the break tags. what do you mean?
Bozho
@Bozho - when I include the text using `a4j:include` the data is displayed as it is - with no line endings as they are not <br /> but unix or win line endings. I put something in the bean to `replaceAll("\n", "<br />")` to see if it worked and it did, but logs STDOUT say the work was done quickly and the browser display of the same text edited with html line break tags causes the text to display correctly, but only after a significant wait (which would be unacceptable to the user).
Mark Lewis