Hi John, "John C. Turnbull" <[email protected]> wrote on 02/01/2009 06:46:41 PM:
> In an applet environment, I believe Rhino cannot use compiled > scripts and hence the performance of those scripts is worse than in > an application environment. Now, given that most browser vendors > have introduced JIT compilers for JavaScript, how difficult would it > be to replace the use of Rhino in Batik applets with the browser’s > JavaScript engine? I imagine there would have to be some changes to > the scripts themselves but Java/JavaScript interaction has greatly > improved since Java 6 Update 10 and using Batik in an applet > environment is very important to me. I don't know what you are doing in the script but I suspect that Batik's performance is generally limited by the underlying Java code not the JavaScript. If you are doing heavy duty operations in script it might make sense to do those in the browsers script engine and then send the results across to the Applet. If your script is interacting heavily with the SVG DOM then it wouldn't surprise me if the extra overhead of the Browser<->Java communication would defeat the gain from using the Browser script engine. In short while it might be a win in a few cases I suspect that the general case is likely to be a wash or close to it, but if anyone has benchmarks or something from projects that have done something similar I'd be interested in hearing about them.
