Instead of slow TCP sockets or named pipes for communicating between a background reader and frontend UI:
// Server / Reader process
HANDLE hMapFile = CreateFileMappingA(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, sizeof(SharedGameState), "Local\\GameOverlayData");
SharedGameState* pShared = (SharedGameState*)MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(SharedGameState));
// Client / Overlay process
HANDLE hMapFile = OpenFileMappingA(FILE_MAP_READ, FALSE, "Local\\GameOverlayData");
const SharedGameState* pShared = (const SharedGameState*)MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, sizeof(SharedGameState));Both processes read and write to the exact same physical RAM pages mapped into virtual memory. Latency is literally 0 nanoseconds (direct RAM read)!