哪种方法更适合调试/分析 - .DLL 还是源代码?

发布于 2024-09-29 01:27:32 字数 335 浏览 1 评论 0原文

我正在开发一个应用程序,我需要对不同方面进行测量,即每种方法所花费的时间和系统资源的压力,以及偶尔进行一些调试以监视数据的处理方式。

我将使用开源库来存储 MIDI 文件,该库可作为源代码以及编译后的 .DLL 。

我在想使用编译后的 .DLL 是否会更容易,因为我不会对库进行任何更改,而且它看起来比在源窗口中拥有一个巨大的参考项目“更整洁”,但我不确定是否这会对调试和测量代码的性能产生影响。

抱歉,如果这个问题已经被问过,我尝试了搜索,但没有出现任何看似相关的内容。

I am developing an application and I will need to take measurements on different aspects, namely time spent in each method and the strain on system resources as well as doing the occasional bit of debugging to monitor how the data is processed.

I'll be using an open source library for MIDI files that is available as source code as well as a compiled .DLL .

I was thinking whether it would be easier for me to use the compiled .DLL as I will not be making any changes to the library and it seems "tidier" than having a huge reference project in the source window however I wasn't sure whether this would have any effect when it came to debugging and measuring the performance of the code.

Apologies if this question has already been asked, I tried a search and nothing seemingly relevant appeared.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情话难免假 2024-10-06 01:27:32

这仅取决于您是否认为必须对其进行调试。性能测量不再是问题。

另请注意,您可以获取该源代码,在本地计算机上构建它并引用 dll(并将 pdb 文件放在同一目录中)。然后,您将能够调试它,而无需实际将项目添加到您的解决方案中。如果您拥有以下三样东西,那么这总是可能的:

  1. dll
  2. 构建 dll 时创建的 PDB
  3. 用于构建 dll 的源

但是,再说一次。如果您认为不需要调试,请立即使用 dll。您以后随时可以获取源代码并重建。

It simply depends on if you think you'll have to debug it at all. Performance measurements are less of an issue.

Note also that you can just get that source code, build it on your local machine and reference the dlls (and have the pdb files lying in the same directory). Then you'll be able to debug it without actually adding the project to your solution. This is always possible if you have these three things:

  1. The dlls
  2. The PDBs created when building the dlls
  3. The source used to build the dlls

But, again. If you think you won't have to debug, just use the dlls straight away. You can always get the source later and rebuild.

皇甫轩 2024-10-06 01:27:32

我发现如果有来源就更容易追踪,因为我可以看到为什么有些东西不起作用。另外,我不确定性能计数器是否可以插入到已编译的 dll 中(但我可能是错的)。

但是,如果您不打算更改它,并且不需要了解它的内部工作原理,那么只需使用 dll。如果您不需要所有这些代码行而只想使用 dll,我当然可以理解不想附加所有这些代码行的意义。

我知道下一部分与调试的方便性无关,但与维护的方便性相关。

当我可以拥有实际代码时,我也不喜欢源代码管理中的 dll,特别是对于可能更改的外部库。我无法告诉您有多少次因为需要更新某些内容而不得不付费升级组件或对代码进行大幅更改。

I find it easier to trace if I have the source because I can see why something isn't working. Also, I'm not sure performance counters can be inserted into compiled dll's (but I could be wrong).

However, if you're not going to change it, and you don't need to understand how it works internally, then just use the dll. I can certainly see the point of not wanting to have all these lines of code attached if you don't need them and just want to use the dll.

I know this next part isn't related to ease of debugging, but it is relevant to ease of maintenance.

I also just don't like dll's in source control when I can have the actual code, particularly for external libraries that are likely to change. I can't tell you how many times I've had to pay to upgrade a component or make drastic changes to my code because something needed to be updated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文