fastwebsockets icon indicating copy to clipboard operation
fastwebsockets copied to clipboard

perf: eliminate frame write fragmentation and optimize buffer management

Open countradooku opened this issue 7 months ago • 0 comments

  • Replace write_vectored with single-buffer writes to avoid fragmentation
  • Optimize buffer allocation patterns for small/large frames
  • Improve masking performance with 64-bit operations and better alignment
  • Add fast-mode constructor with performance-optimized defaults
  • Reduce unnecessary buffering in read path for large payloads

Addresses feedback about performance parity with simpler WebSocket implementations. Eliminates the main performance bottlenecks: header/payload fragmentation, excessive buffering, and suboptimal memory access patterns.

countradooku avatar Jun 04 '25 20:06 countradooku