packBytes
packBytes copied to clipboard
Use pre-allocated buffers, remove getDataSize()
As discussed here https://github.com/uNetworking/uWebSockets.js/issues/894 it's more efficient to pre-allocate buffers and slice after encode vs calculating exact size before encode which uses more cpu cycles. Removing getDataSize() function will reduce complexity and improve speed