Skip to content

bugfix: resolve performance issue with steamshim#548

Merged
pollend merged 1 commit into
masterfrom
bugfix/resolve-performance-issue-steam-shim
May 14, 2026
Merged

bugfix: resolve performance issue with steamshim#548
pollend merged 1 commit into
masterfrom
bugfix/resolve-performance-issue-steam-shim

Conversation

@pollend
Copy link
Copy Markdown
Collaborator

@pollend pollend commented May 14, 2026

This pull request introduces a significant refactor and improvement to the Steam networking (SDR) packet handling system, transitioning from synchronous, request-based message polling to an event-driven, buffered architecture. The main goals are to improve packet delivery efficiency, reduce blocking, and ensure robust cleanup of resources. The changes affect both the game-side networking code (net.c) and the SteamShim IPC layer (parent.cpp, child.cpp, mod_steam.h).

The most important changes are:

Networking Layer Refactor and Buffering:

  • Replaces synchronous packet polling with an event-driven, buffered system for SDR packets. Incoming Steam messages are now buffered per connection slot and delivered asynchronously to the game, improving performance and reliability (net.c). [1] [2]
  • Adds robust cleanup of buffered packets and slot management on disconnect and shutdown to prevent memory leaks (net.c). [1] [2]

SteamShim Event and Message Handling:

  • Implements background draining of all tracked Steam connections in the SteamShim child process, pushing received messages as events to the parent process. The parent now processes these events via a non-blocking, buffered dispatch loop, decoupling network polling from game logic (child.cpp, parent.cpp). [1] [2] [3] [4]
  • Refactors the parent dispatch logic to use a shared accumulation buffer (dispatchBuf) for efficient, non-blocking packet processing, and ensures correct synchronization and memory management (parent.cpp).

API and Interface Updates:

  • Updates the SteamShim interface to expose the current sync index and ensure all new functions are properly declared and accessible (mod_steam.h). [1] [2] [3] [4]

These changes collectively modernize the SDR networking path, making it more robust, less blocking, and easier to maintain.

Signed-off-by: Michael Pollind <mpollind@gmail.com>
@pollend pollend merged commit 6260828 into master May 14, 2026
10 checks passed
@pollend pollend deleted the bugfix/resolve-performance-issue-steam-shim branch May 14, 2026 15:45
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