Hi,
I'm interested in what Charles said in
http://www.nabble.com/-ANN--ruby2java-0.0.1-Released-td23679153.html
about "jruby.compile.mode=FORCE." This option works in
Ruby#runNomally(Node scriptNode) method and causes compilation. So, I
implemented a feature to set this option and compared with no
compilation mode. The result was not that expected. The reason would
be that runNormally() method compile the script everytime before
evaluation. When I executed testString.rb a hundred times, the result
was:
CompileMode.OFF 2983 ms
CompileMode.JIT 21463 ms
CompileMode.FORCE 21032 ms
I used a parse-once-eval-many-times feature to test it, so I could
conclude that the compilation itself was so slow.
Next, I implemented a "compile-once-eval-many-times" feature. To make
this, I changed two private methods to be public, "public Script
tryCompile(Node node)" and "public IRubyObject runScript(Script
script), so that external programs can execute compilation and
evaluation individually. This time the result was:
CompileMode.OFF 2979 ms
CompileMode.JIT 2785 ms
CompileMode.FORCE 2671 ms
This was a great improvement, but the two compilation modes were still
not so fast compared with no compilation.
In general, how fast does a compiled script run compared with no
compilation mode?
If ruby2java makes it really fast, I want to execute ruby2java script
in Java before evaluations. In this case, the problem would be how to
get a compiled script and eval it. I want to avoid reading a compiled
script from a file. Any idea?
-Yoko
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email