gpt4 book ai didi

windows - 发布版本中与 OutputDebugString 相关的开销

转载 作者:可可西里 更新时间:2023-11-01 12:18:01 26 4
gpt4 key购买 nike

在发布构建中调用 OutputDebugString 是否有显着的开销?

最佳答案

测量 - 1000 万个调用大约需要 50 秒。我认为对于未使用的功能来说这是一个很大的开销。

使用宏可以帮助在发布构建中摆脱这种情况:

#ifdef _DEBUG
#define LOGMESSAGE( str ) OutputDebugString( str );
#else
#define LOGMESSAGE( str )
#endif

不仅删除了调用,而且参数评估和文本字符串也被完全删除,您将不会在二进制文件中看到它们。

关于windows - 发布版本中与 OutputDebugString 相关的开销,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/729435/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com