Is there an established way of measuring (or getting an existing measure) a JDK class method complexity? Is javap
representative of time complexity and to what degree. In particular, I am interested in the complexity of Arrays.sort()
but also some other collections manipulation methods.
E.g. I am trying to compare two implementations for performance, one is using Arrays.sort()
and one doesn't. The javap
disassembly for that doesn't returns a lot more steps (twice as many) but I am not sure if the one that does excludes the Arrays.sort()
steps. IOW, does javap
of one method include a recursive measure of the methods invoked within or just for that method?
Also, is there a way, without modifying and recompiling the Java code itself, to find how many loop iterations were done when a certain base Java method was invoked on specific parameters? E.g. measure the number of iterations of Arrays.sort('A', 'r', 'T', 'f')
?