Response time of web requests

87 Views Asked by At

We have a web application which is implemented in 3 tier architecture using J2EE stack. The application is mainly fetching the result set from the database based on search criteria and our stack uses GWT, EJB3.0 hibernate and a RDBMS.

We have our search logic/queries in stateless session beans. The servlets/controller invoke these stateless session beans to fetch the search results. Since we are using GWT as UI framework, so we use POJO/models to render on UI widget like table/grids etc.

Our model objects are way too heavy , since contains lot of business information in order to show in UI and it has to run array of queries, permissions etc. Due to this, the searches are taking pretty long. In an average if each model generation is taking 1 sec, it takes around 15 secs to generate 15 models which is our pagination limit on UI.

I want to optimize the model generation time,I can think of running model generation in a thread but how do I maintain the order of the results from DB/WS. Could you suggest what are all the best possible way to improve the response time ?

Pseudocode on SLSB looks like below.

search(criteria,paging properties){
Get PRIMARY keys by running the query based on search criteria from DB/WS
for each key/id  build the model //This is taking too long as it's synchronous 
return list of models in sorting order back to controller with paging properties

} 
0

There are 0 best solutions below