This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Performance optimization in Web Service code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Performance optimization in Web Service code" Watch "Performance optimization in Web Service code" New topic
Author

Performance optimization in Web Service code

Dixit Saurabh
Greenhorn

Joined: Jun 26, 2010
Posts: 5
Hello Guys,

I am working on web application, which open a pop up when it starts. Data required for this pop up come by webservice. This webservice execute query in DB and return a instance of UserDefined class. I get data from this userdefined instance.

Problem is: this web service is very slow, Some times I got response in appx. 10 second. I need to do some performance optimization in web service code. So Please suggest me, where I can optimize code?

Doubt: 1) It is a good practice to send directly object in web service response instead jason object or XML in web service response?
2) what should be waiting time for web service response?

Please reply.
Thanks in advance!!!
Saurabh
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 613
very open ended question, you first need to find out whats taking long? I suspect it to be query but its just wild guess, try to mock (Dont call actuall db but send dumy object) the database call and see if there is improvement like wise mock each possible layer.
if client is web how are you passing object back? it has to be xml or json.

use some profiling tool to find out where is the bottleneck.

All desirable things in life are either illegal, banned, expensive or married to someone else !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Performance optimization in Web Service code
 
Similar Threads
WebService for JPA Domain model dilemma
finalize help plzzz
Glue 5.0.2 throws Exception (protocol: Authentication Failed)
passing collection object as an argument to Web service
Check if web service is running