perf(secure_tcp_socket): add std::span receive callback to remove per-read allocations#322
Merged
Merged
Conversation
…-read allocations - Add set_receive_callback_view() API for zero-copy span-based receive - Implement lock-free callback access using shared_ptr + atomic operations - Prefer view callback over vector callback when both are set - Remove mutex from receive hot path for better performance - Keep legacy vector callback for backward compatibility Part of #317
Add documentation for secure_tcp_socket zero-allocation receive path feature in both English and Korean CHANGELOGs. Part of #317
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
5 tasks
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
…-read allocations (#322) * perf(secure_tcp_socket): add std::span receive callback to remove per-read allocations - Add set_receive_callback_view() API for zero-copy span-based receive - Implement lock-free callback access using shared_ptr + atomic operations - Prefer view callback over vector callback when both are set - Remove mutex from receive hot path for better performance - Keep legacy vector callback for backward compatibility Part of #317 * docs: update CHANGELOG for secure_tcp_socket span callback Add documentation for secure_tcp_socket zero-allocation receive path feature in both English and Korean CHANGELOGs. Part of #317 * docs: add secure_tcp_socket zero-copy receive to changelog Document the new set_receive_callback_view() API that provides zero-copy TLS data reception using std::span and lock-free callback storage for improved performance under high TPS. Refs: #317, #315, #316
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
set_receive_callback_view(std::span<const uint8_t>)API for zero-copy TLS data receptionshared_ptr+atomic_load/storeChanges
Header (
include/kcenon/network/internal/secure_tcp_socket.h):<span>includeset_receive_callback_view()method with comprehensive documentationshared_ptrfor atomic accessImplementation (
src/internal/secure_tcp_socket.cpp):set_receive_callback_view()with atomic storedo_read()to prefer view callback (zero-copy) over vector callbackTest plan
-DCMAKE_BUILD_TYPE=ReleaseNotes
tcp_socketimplementation from perf(tcp_socket): add std::span receive callback to remove per-read allocations #316 for consistencyCloses #317
Part of #315