Christian Campo wrote:
> I have doubts that this is a good solution. (even thought it works in
> your case). Since Hessian supports HTTP 1.1. it has good reason to
> leave a connection open so that it can reuse it, if you do the next
> call to the same webservice.
> We found that Hessian can do quit a number of subsequent calls on the
> same connection and I sure this improves the speed a lot.
>
> May you can tell what your test looks like. Are you getting a service
> proxy for each webservice call or are you reusing old proxy objects.
> ???
>
> Because of this we went as far as building a little cache of service
> proxy objects so that our application can reuse the embedded
> connection.
>
> regards
> christian campo
>
>
You are probably right that this is not a good solution. I'm not
an expert in hessian. I'm only evaluating if hessian can be used
in one of my projects.
I just tried to run the client on another computer without problems,
so it could be a problem when the server and the client are on the same box.
My test is here:
Basic.java:
package dk.jansdal.hessian;
public interface Basic {
public String hello();
}
BasicImpl.java:
package dk.jansdal.hessian;
public class BasicImpl implements Basic {
public String hello () {
return "hello world";
}
}
Client.java:
package dk.jansdal.hessian;
import com.caucho.hessian.client.HessianProxyFactory;
public class Client {
public static void main(String[] args) throws Exception
{
String url = "http://127.0.0.1:10001/basic";
HessianProxyFactory factory = new HessianProxyFactory();
Basic basic = (Basic) factory.create ( Basic.class, url );
long start = System.currentTimeMillis();
for ( int i = 0; i < 100000; i++ ) {
String s = basic.hello();
}
long stop = System.currentTimeMillis();
System.out.println ( "Time: " + (stop-start) );
}
}
My box is a 1.9GHz Athlon running W2K and JDK 1.4.2_05
regards
Steen
Received on Tue 07 Dec 2004 02:46:43 -0800
This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:40 PDT