refactor: cache patch buffer in connection struct to reduce allocations perf: optimize buffer compaction in connection read handling