In trying to optimize C and LISP, looking at the assembler code output by the compiler can be a great help.
Clojure presumably compiles to a JVM bytecode that would be equally helpful.
How do I see it?
In trying to optimize C and LISP, looking at the assembler code output by the compiler can be a great help.
Clojure presumably compiles to a JVM bytecode that would be equally helpful.
How do I see it?
Some hand-made solutions:
Clojure dynamically compiles all the Clojure code to bytecode at the runtime. I am not sure how you can see this dynamically compiled bytecode. However, you can do Ahead Of Time (AOT) compilation of your Clojure code yourself and that will generate .class files. Then you can use javap
to see the bytecode.
Use the compile
function in Clojure/core to compile your namespace:
compile function
Usage: (compile lib)
Compiles the namespace named by the symbol lib into a set of classfiles. The source for the lib must be in a proper classpath-relative directory. The output files will go into the directory specified by compile-path, and that directory too must be in the classpath.
Then use javap
:
javap -l -c -s -private MyClass