I have some strange problem. I need to minimize the execution time of remote ejb method invokation. I have Tomcat that comunicates with jboss and use ejbs for business logic. In my struts action i lookup remote interface(takes 8-10 ms??!?!) and the ejb method in tomcat is done for ~200ms, but in jboss it is ~100ms. I dig about that and it seems that the remote interfaces are doing marshaling serializing and unmarshaling, So may be those 100ms go into that? There are no network problems. How to improve that? And one other thing is it save to look up all interfaces on app start up and push them in some global hash and use them in the whole app in order to skip the 8-10 ms lookup every time?
if your client code which looks up EJB resides in same JVM where your EJB's are deployed. then you can use EJB local interface rather than remote interface.
Another thing is you can use ServiceLocator pattern and cache the home object to prevent the expensive look up.