Drop hot per-GetWindowLong debug log in window.cpp#139
Open
BinqAdams wants to merge 1 commit intoNVIDIAGameWorks:mainfrom
Open
Drop hot per-GetWindowLong debug log in window.cpp#139BinqAdams wants to merge 1 commit intoNVIDIAGameWorks:mainfrom
BinqAdams wants to merge 1 commit intoNVIDIAGameWorks:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. TheLogger::debugcall constructs astd::stringstreamviaformatMessageon every call regardless of the configured log level — the level check happens later inemitLine— so the cost is paid even when the message would be discarded.SetWindowLonglogging is left in place: it fires only on actualWndProcupdates and is genuinely useful for diagnosing wndproc ownership.What Changed
bridge/src/client/window.cpp: remove theLogger::debug(format_string(kStr_newGetWindowLong_gettingWndProc, …))call insideNewGetWindowLong.bridge/src/util/log/log_strings.h: remove the now-unusedkStr_newGetWindowLong_gettingWndProcformat 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.