1

I'm experimenting (with some friends) with JVM languages, such as Clojure and Scala. We recently found a functional solution to an algorithm that performed 30 times faster in Scala than in Java. With these functional languages, has anyone used a bytecode profiling tool to see what these functions become in JVM bytecode? What is the best tool to use for this purpose?

For that matter, as I'm just starting to look at bytecode instrumentation and profiling products, which tool is the best to use? I see recommendations on Stackoverflow, but I'm not sure if they are specifically tuned to the desire to see what machine implementation differences exist between two pieces of code, or if they are purely for code-coverage purposes, which is not my interest.

1 Answer 1

3

From the tool perspective, JVM languages don't pose any different problem to profiling than plain Java bytecode. What you need is to get an understanding of how things work behind the hood of your fancy functional constructs in order to properly read the results of your profiler.

YourKit or visualVM will be then your friends again.

3
  • Then what I really need is a decompiler to see what the constructs map to in java, right? Feb 8, 2013 at 0:37
  • That might help, then you should look at the specifics of the JVM language at hand. Clojure has a quite fixed structure to translate fns, protocols and data types to Java classes, you will get used to it and be able to "read" the class names involved in the profiler results.
    – skuro
    Feb 8, 2013 at 9:11
  • Thank you, that confirms what I suspected. Feb 8, 2013 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.