An algorithm written in Java should be faster than the same algorithm written in JRuby, right?.
However, if I write the algorithm in Java and then call it from JRuby, will I still get the performance advantages of java?
I ask this because I am writing a very complicated utility class for my JRuby on Rails app and need to choose whether to do it in Java or JRuby.
So, if I use the following code:
class UtilitySampleWrapper
include Java
require 'utility.jar' #could also use .js class files if that makes a difference
def initialize
@p = Utility.new #this is the java utility class
end
end
Will any code run in the @p object of Utility class be run in pure java and have all of the speed advantages that implies?
if I call
@p.iterate(50)
will the iterate function of the Utility class run in pure Java and then return its result to my JRuby code?
Thanks!