Web Services Performance problem  
Author Message
lookraja





PostPosted: 2003-12-18 22:02:00 Top

java-programmer, Web Services Performance problem I am trying to use web services in our project in websphere server, In
this we are using swing as client to connect the EJB, which is running
thru web services. we are able to connect EJB and get the response
from websphere server using web services. The below code is in EJB as
business method

public Vector getData(){
Vector v = new Vector();
for(int i=0;i<20000;i++)
v.add("String");
return v;
}
I use SOAP RPC encoding and in the client side i use SOAP.jar to
connect the web service and get the response.
but it takes around 8 seconds to get the response.

at the same time, i used below code in EJB as business method

public Vector getData(){
Vector v = new Vector();
for(int i=0;i<20000;i++)
v.add(new DataObject("String"));
return v;
}

public class DataObject{
String str = null;
public DataObject(String data){
str = data;
}

public String getData(){
return str;
}

public void setData(String data){
this.data = data;
}

}

here, i create object for my own DataObject class.

now i connect to this EJB, it takes double the amount of time to get
the response.

Please help me, Is there any other way to increase the performance of
web services?

Thanks,
Raja
 
The Ghost In The Machine





PostPosted: 2003-12-20 1:00:00 Top

java-programmer >> Web Services Performance problem In comp.lang.java.advocacy, Raja
<email***@***.com>
wrote
on 18 Dec 2003 06:02:10 -0800
<email***@***.com>:
> I am trying to use web services in our project in websphere server, In
> this we are using swing as client to connect the EJB, which is running
> thru web services. we are able to connect EJB and get the response
> from websphere server using web services. The below code is in EJB as
> business method
>
> public Vector getData(){
> Vector v = new Vector();
> for(int i=0;i<20000;i++)
> v.add("String");
> return v;
> }
> I use SOAP RPC encoding and in the client side i use SOAP.jar to
> connect the web service and get the response.
> but it takes around 8 seconds to get the response.
>
> at the same time, i used below code in EJB as business method
>
> public Vector getData(){
> Vector v = new Vector();
> for(int i=0;i<20000;i++)
> v.add(new DataObject("String"));
> return v;
> }
>
> public class DataObject{
> String str = null;
> public DataObject(String data){
> str = data;
> }
>
> public String getData(){
> return str;
> }
>
> public void setData(String data){
> this.data = data;
> }
>
> }
>
> here, i create object for my own DataObject class.
>
> now i connect to this EJB, it takes double the amount of time to get
> the response.
>
> Please help me, Is there any other way to increase the performance of
> web services?
>
> Thanks,
> Raja

You are transmitting 120K of data, at least. In fact, it's probably
more like 320K, when all of the XML overhead is considered. I'd
frankly have to measure it to get an exact value; all I know is
that you have 20,000 * 6 = 120,000 ASCII characters = 120,000 bytes
in UTF-8.

That's quite a bit, although by itself that wouldn't cause
an 8 second or 16 second delay unless you're using a
sucky 56k phone line, in which case it might take a minute
to just transmit that amount of data.

Perhaps if you were to reduce the amount of transmitted data
and see if that helps? If it does, you've got a bandwidth problem.
If not, you've got a response problem. :-)

--
#191, email***@***.com
It's still legal to go .sigless.
 
Silvio Bierman





PostPosted: 2003-12-20 8:13:00 Top

java-programmer >> Web Services Performance problem For one I see 20000 object allocations in the second code fragment that are
not in the first.

Silvio Bierman


 
 
Kent Paul Dolan





PostPosted: 2003-12-21 14:21:00 Top

java-programmer >> Web Services Performance problem "Raja" <email***@***.com> wrote
> public Vector getData(){
> Vector v = new Vector();
> for(int i=0;i<20000;i++)
> v.add("String");
> return v;
> }

For one thing, yes, Vector is self-extending,
but no, it isn't time efficient to use it that way.

Try "Vector v = new Vector(20000,200);" and see if
that helps any.

xanthian.


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG