wood burning stoves 2.0*
The moose likes JSF and the fly likes dataTable renders slow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "dataTable renders slow" Watch "dataTable renders slow" New topic
Author

dataTable renders slow

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
I have a query which gives 500 records at once.

The query ends after appox. 1-2 seconds.

I bind the result-list to my datatable.

The list (ArrayList) is filled within 1-2 seconds successfully,
but JSF needs further appox. 5 seconds to render my datatable with that list.

Is that normal??

The list is returned within 2 seconds, but the datatable needs further 5 seconds.

So I have to wait appox. 7 seconds for the view.

How can I accelarate that?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
500 records at once is not normal, no. Introduce paging. An average user already don´t like more than 100 items per view.

5 seconds is also not normal, no. Upgrade your JSF version if necessary. There were been a lot of performance enhancements since JSF came out for the first time. Assuming you´re using Mojarra / RI, you can get the most recent here: https://javaserverfaces.dev.java.net
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You may find this tool useful as well: http://www.prime.com.tr/facestrace/
Demo: http://www.nightdev.devisland.net/facestrace-example/createBook.jsf
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
Look at my phase listener:


AFTER 2 Seconds the RENDER_RESPONSE 6 occurs, BUT NOW I HAVE TO WAIT appox 5 seconds after the second "RENDER_RESPONSE 6"
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Uh, yes, OK.

Now, have you read my replies at any way?
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
the thing is, when I reduce the rows via rows-Attribute of my datatable then it s renderes faster as using a higher number. I use Facelets (in debug-modus) and JSF 1.2.

I do not want to reduce my row-number as I use a datascroller and a paginator (this works well).

The datascroller shows only a little amount of the datas and have the advantage not to use the paginator to often!

But I cannot understand why my view renders sooo slowly even the phase listener says that all phases are done.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
If it´s fast enough on the server side, then it´s just a client side issue. The client is apparently using a slow webbrowser and/or a slow PC. MSIE for instance is a slow browser. Try for example Opera, it is known to build up the DOM tree very fast. Google Chrome is known to execute Javascript very fast (the dataScroller is overloaded with huge amount of Javascript, you know).
Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

Hi,
I too have the same issue. I used JProfiler and its showing that each JSFComponent is taking considerable amount of time to render,especially if i increase the number of users to 20, the page is taking approximately 17-18 secs to render. I have one datatable which renders atmost 60 records. Each record is a command link. Other than that i've two subviews which has some text boxes and output texts. I'm using tomahawk tiles view handler. Hope it is not causing any problem.I am using jsf1.1. I cannot use jsf1.2. Any suggestions to improve performance.?
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
Hello,

I guess, Bauke is right by saying that this is only a client-side-issue.


For example, I am using Firebug and found out, that switching it off renders the page very faster !!!

Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

Hi,
MSIE is the only suggested browser for our clients..And as you said it is taking lot of time to render the page..We have to use that only. So you are saying that as long as we use IE performance will be bad rite?
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
I do not know, but it is definitly a client-side-issue as the server is really fast enough.

For example, in Mozilla with about:config you can set the browser. For example: layout.inital.delay or the like.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dataTable renders slow