Last 12 weeks · 7 commits
2 of 6 standards met
Improves memory efficiency and reduces CPU overhead in the WebSocket writing and fragment processing logic. Shifted to ownership transfers and in-place mutations and reduced the number of heap allocations and eliminate unnecessary buffer zero-initializations. Operation After this PR Write Header Allocation + Copy Decode Text $O(1)$ Ownership transfer / Truncate
Issue #90 was closed with "blocking (synchronous) API is not a goal for fastwebsockets" — curious about the reasoning behind this. Is the core frame parser fundamentally tied to , or is it more of a scoping/maintenance decision? Asking because we run latency-sensitive WebSocket consumers on CPU-pinned threads with non-blocking + epoll busy-polling (no async runtime). The frame parsing performance of fastwebsockets is very appealing, but wrapping it in a single-threaded tokio runtime adds indirection we'd prefer to avoid. If the frame codec were generic over (with the async variant as a thin wrapper), it would open up fastwebsockets to a wider set of use cases without changing the async API. Happy to contribute if this is something you'd consider.
https://github.com/denoland/fastwebsockets/blob/7d53d0130da5e94db947fdf6aa3da51dc8f53c6b/src/lib.rs#L647-L650 A single utf-8 character may contain multiple bytes and fragmentation may lead to the last segment having partial utf-8. rfc 6455 has already suggested this. I can guess that this is relatively unlikely to happen, fragmentation of a text segment from the middle of a non ascii character, but is not impossible. Specially if the text contains 4-byte emojis or is a non English text.
Repository: denoland/fastwebsockets. Description: A fast RFC6455 WebSocket implementation Stars: 1133, Forks: 111. Primary language: Rust. Languages: Rust (86.2%), C (8.7%), JavaScript (3.5%), Makefile (1.6%). License: Apache-2.0. Homepage: https://docs.rs/fastwebsockets/ Open PRs: 8, open issues: 11. Last activity: 3w ago. Community health: 37%. Top contributors: littledivy, divybot, bartlomieju, mmastrac, erebe, AaronRecord, kaniini, Avi-D-coder, Caiooooo, dxvid-pts and others.