开发者

Which method is better for debugging/profiling - .DLL or source code?

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 tri开发者_如何学运维ed a search and nothing seemingly relevant appeared.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜