packBytes icon indicating copy to clipboard operation
packBytes copied to clipboard

Use pre-allocated buffers, remove getDataSize()

Open e3dio opened this issue 2 years ago • 0 comments

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

e3dio avatar May 02 '23 18:05 e3dio