简体   繁体   English

YourKit分析和行号

[英]YourKit Profiling and Line Numbers

I am using the YourKit Java profiler to find CPU hogging spots in some Java code. 我正在使用YourKit Java Profiler在某些Java代码中查找CPU占用点。 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. 我没有Java类的原始源代码,因此我一直在对其进行反编译以查看需要解决的问题。

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. 反编译代码上的行号(使用JD-GUI,我尚未进行任何其他测试)与YourKit Profiler CPU采样窗口中显示的行号不一致

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. 如下所示,EnergyNetwork.getAcceptors()的输出行号为86行。但是,在JD-GUI中,它显示的是行86。

YourKit输出反编译器输出

I had great results for the (foreign) code I use with JD-GUI, as long as the code was not obfuscated. 只要我对JD-GUI所使用的(外部)代码没有混淆,就可以取得很好的效果。 Did you try the latest version of JD-GUI ? 您是否尝试了最新版本的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. 这样,您可能可以更好地控制代码到源的映射,最后,由于您要解决性能问题,因此无论如何还是有必要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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