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
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
精彩评论