Skip to content

Drop hot per-GetWindowLong debug log in window.cpp#139

Open
BinqAdams wants to merge 1 commit intoNVIDIAGameWorks:mainfrom
BinqAdams:cleanup/drop-getwindowlong-debug-log
Open

Drop hot per-GetWindowLong debug log in window.cpp#139
BinqAdams wants to merge 1 commit intoNVIDIAGameWorks:mainfrom
BinqAdams:cleanup/drop-getwindowlong-debug-log

Conversation

@BinqAdams
Copy link
Copy Markdown
Contributor

Summary

Remove a debug log line that fires on every NewGetWindowLong<>(GWLP_WNDPROC) call, plus its now-orphaned format string.

Motivation

NewGetWindowLong<>(GWLP_WNDPROC) is a hot path: any host process that periodically queries the window procedure (some game engines do this once per frame, or per input event) drives this log line at high frequency. The Logger::debug call constructs a std::stringstream via formatMessage on every call regardless of the configured log level — the level check happens later in emitLine — so the cost is paid even when the message would be discarded.

SetWindowLong logging is left in place: it fires only on actual WndProc updates and is genuinely useful for diagnosing wndproc ownership.

What Changed

  • bridge/src/client/window.cpp: remove the Logger::debug(format_string(kStr_newGetWindowLong_gettingWndProc, …)) call inside NewGetWindowLong.
  • bridge/src/util/log/log_strings.h: remove the now-unused kStr_newGetWindowLong_gettingWndProc format string.

Net diff: 2 files, +1 / -3.

Testing

The removed log line was a pure side-effect (no return value, no state mutation). Bridge behavior is unchanged for any caller of NewGetWindowLong<true|false>; only the per-call debug emission is gone. Verified via normal level-load and HUD/menu interaction that no bridge functionality regressed.

NewGetWindowLong<>(GWLP_WNDPROC) is a hot path - every host process
that periodically queries the window procedure (some game engines
do this once per frame, or per input event) drives this log line at
high frequency. The Logger::debug call constructs a std::stringstream
via formatMessage on every call regardless of the configured log
level (the level check happens later in emitLine), which is
expensive on the hot path.

Removes the call site at window.cpp:103 and the orphaned format
string kStr_newGetWindowLong_gettingWndProc in log_strings.h.
SetWindowLong logging is preserved - it fires only on actual
WndProc updates and is genuinely useful for diagnosing wndproc
ownership.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant