Subj : Performance of calling external Java method as compared to native Java To : netscape.public.mozilla.jseng From : "Neil Kolban" Date : Sun Oct 05 2003 10:39 pm Folks, I am looking at embedding the Rhino JavaScript engine in a product. To that end, I have been examining performance capabilities. I have a Java class called "A" that has a method called "callMe" that takes a string as a value and does nothing with it. In JavaScript, I have the following: var i; myA = new A(); for (i=0; i<2000000; i++) { myA.callMe("Hello"); } In Java, I have the following A myA = new A(); for (i=0; i<2000000; i++) { myA.callMe("Hello"); } In JavaScript, the code takes 3578 milliseconds to execute while on the same machine, the Java code takes 484 milliseconds. Is this expected? Is there any way I can improve the time to call a Java function? Neil .