生成调试信息(pdb)是否会使我的应用程序在运行时变慢?

时间:2021-08-07 20:45:24

In .NET applications is generating debug info (pdb) making my application slower in runtime? or do they only comes into the play when the application crashes?

在。net应用程序中生成调试信息(pdb)使我的应用程序在运行时更慢?或者它们只在应用程序崩溃时才出现吗?

1 个解决方案

#1


5  

They only come into play when the program crashes. PDB's just contain information for mapping run-time information to source information that is useful for debugging.

它们只有在程序崩溃时才会发挥作用。PDB只包含将运行时信息映射到对调试有用的源信息的信息。

However, building your program in debug mode versus retail mode can make it slower at runtime. This is independent of PDB's - You can generate debug info for retail binaries and use it for debugging. Debug builds typically are less-aggressively optimized in order to make debugging easier.

但是,在调试模式和零售模式下构建您的程序可以使它在运行时变得更慢。这与PDB无关——您可以为零售二进制文件生成调试信息并将其用于调试。调试构建通常是不那么积极地优化,以便使调试更容易。

You should always generate PDB's, even for retail builds. Retail builds are usually what gets deployed, and therefore many problems you'll look at will be from these systems.

您应该总是生成PDB的,即使是零售构建。零售构建通常是要部署的,因此您将看到的许多问题将来自这些系统。

#1


5  

They only come into play when the program crashes. PDB's just contain information for mapping run-time information to source information that is useful for debugging.

它们只有在程序崩溃时才会发挥作用。PDB只包含将运行时信息映射到对调试有用的源信息的信息。

However, building your program in debug mode versus retail mode can make it slower at runtime. This is independent of PDB's - You can generate debug info for retail binaries and use it for debugging. Debug builds typically are less-aggressively optimized in order to make debugging easier.

但是,在调试模式和零售模式下构建您的程序可以使它在运行时变得更慢。这与PDB无关——您可以为零售二进制文件生成调试信息并将其用于调试。调试构建通常是不那么积极地优化,以便使调试更容易。

You should always generate PDB's, even for retail builds. Retail builds are usually what gets deployed, and therefore many problems you'll look at will be from these systems.

您应该总是生成PDB的,即使是零售构建。零售构建通常是要部署的,因此您将看到的许多问题将来自这些系统。