Subj : Rhino speed To : netscape.public.mozilla.jseng From : Dave Thorn Date : Mon Feb 14 2005 10:00 pm Hello, I've been investigating rhino as one of the engines to add scripting to a java application. I've got it running scripts in three ways: 1) "Standalone" - Context cx = Context.enter(); (version 1.6R1) 2) Via Apache's BSF (Bean Scripting Framework) (version 1.5R3) 3) using jsc - the javascript compiler (version 1.6R1) Doing some performance comparisons with native Java code, I found the rhino scripts were running rather slowly in comparison. Some operations that took subsecond times in java were taking up to 14 seconds in any rhino implementation. This was relatively straightforward code, just a large number of iterations, adding integers to an ArrayList, and integer comparison. The speed difference did surprise me somewhat, but especially so with the jsc version. I don't know much about bytecode or compilers, but if jsc compiled it to bytecode, then I was expecting similar speeds to native Java. Do I simply have naive expectations? Am I perhaps doing something wrong? Any and all suggestions and comments appreciated. -- dave thorn .