[jboss-user] [Performance Tuning] - Jndi lookup performance
int2
do-not-reply at jboss.com
Thu May 10 04:28:33 EDT 2007
Hi everyone,
I have done a simple test on jndi lookup (on a separated client). I just really upset that the average time for the lookup is around 400 ms (local machine) and 500ms (remote machine).
I just wonder is there something wrong with my performance optimization ?
Following is the code of the client
public static void main(String[] args) {
| // TODO Auto-generated method stub
|
| if (System.getSecurityManager() == null)
| System.setSecurityManager(new RMISecurityManager());
| Calendar c = Calendar.getInstance();
|
| Properties env = new Properties();
| env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| //switch to 'localhost:1100' for performance comparison
| env.setProperty("java.naming.provider.url", "192.168.1.2:1099");
| env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
| try{
| long start = System.currentTimeMillis();
| Context ctx = new InitialContext(env);
| Object ref = ctx.lookup("BBean/remote");
|
|
| long end = System.currentTimeMillis();
| long el = end - start;
| System.out.println("elapse(ms): " + el);
| }
| catch(NamingException e){
| e.printStackTrace();
| }
| }
Thank you a lot and regards
Boehm
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044599#4044599
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044599
More information about the jboss-user
mailing list