I've created an remote ejb bean for an application of mine that runs on a wildfly server. Both, the server and the client that connects to the server, run on the same machine (my local computer). Now I've seen observed, that from the beginning of the call to its return it takes a little over 500 milliseconds on average, but the call itself on the server side only needs 3 milliseconds. These values were observed with the new java 8 datetime api both on the server and on the client side. What I now would like to know is, if it's somehow possible to decrease the needed time until the client receives the result from the server. Unfortunatly I couldn't find any meaningfull informations to achieve this on the internet, which is the reason why I ask here.
On another note, I also tried to use REST as a technology to make my server calls from the client, the needed time was almost the same with a difference of only 1 - 10 milliseconds to the ejb call. Because of this I would guess that the reason for the slow call is either the ejb object instantiation or the marshalling of the parameters or results of the calls.
Thanks for your help!
Biro