简体   繁体   中英

YourKit Profiling and Line Numbers

I am using the YourKit Java profiler to find CPU hogging spots in some Java code. I do not have the original source code for the Java classes, so I have been decompiling it to see what needs to be fixed.

The line numbers on decompiled code (using JD-GUI, I have not tested with anything else yet) do not line up with those shown in the YourKit profiler CPU sampling window.

Is there a decompiler available that will match up original source file line numbers with the decompiled code?

As you can see below, the output line number for EnergyNetwork.getAcceptors() is line 86. Yet, in JD-GUI it shows line 86 to be a list.

YourKit输出反编译器输出

I had great results for the (foreign) code I use with JD-GUI, as long as the code was not obfuscated. Did you try the latest version of JD-GUI ? And just an idea: is the code you get so fit that it could be compiled again ? This way you might have better control about code to source mapping and in the end this would be necessary anyway because you want to fix the performance problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM