Currently, every client will prepare its own frame and (in some cases) copy its content into a new bytes object before passing it to the loop Transport.write.
See example
Instead, the library could use the first client write buffer to prepare frame and make a necessary bytes object only once. Then pass it to the transport layer of all clients.
This way we eliminate memcpy in some cases twice per client. With big message sizes memcpy costs are very expensive, such optimization will give a decent boost.
Currently, every client will prepare its own frame and (in some cases) copy its content into a new bytes object before passing it to the loop Transport.write.
See example
Instead, the library could use the first client write buffer to prepare frame and make a necessary bytes object only once. Then pass it to the transport layer of all clients.
This way we eliminate memcpy in some cases twice per client. With big message sizes memcpy costs are very expensive, such optimization will give a decent boost.