Profiling a simple scenario: $ ~/Install/jdk9u20/bin/java -jar dist/nashorn.jar -Dnashorn.typeInfo.disabled=false --class-cache-size=0 --persistent-code-cache=false -scripting --log=time test/script/basic/compile-octane.js -- --iterations 5 ...yields a few simple low-hanging fruits, here is one of them. Out of 320 seconds of run, 20 seconds is spent here: 19.750 jdk.nashorn.internal.ir.IdentNode.accept(jdk.nashorn.internal.ir.visitor.NodeVisitor) 19.750 jdk.nashorn.internal.codegen.ApplySpecialization$1.leaveIdentNode(jdk.nashorn.internal.ir.IdentNode) 19.140 java.lang.UnsupportedOperationException.<init>() 19.150 java.lang.RuntimeException.<init>() 19.150 java.lang.Exception.<init>() 19.150 java.lang.Throwable.<init>() 20.290 java.lang.Throwable.fillInStackTrace() Please throw some different from UOE from ApplySpecialization$1.leaveIdentNode(), the exception with fillInStackTrace() overridden should be best. You may also consider throwing the pre-cached exception from the static field, if that is not messy for the Nashorn code.
|