To send binary messages with WebSocket, I can use either Node.js Buffers or Typed Arrays.
Is there a significantly difference in term of performance between them ?
To send binary messages with WebSocket, I can use either Node.js Buffers or Typed Arrays.
Is there a significantly difference in term of performance between them ?
As they both utilise raw memory under the hood, I doubt you will find any noticeable performance differences in general. That being said, performance is usually more about how you use these structures.
As you should never prematurely optimise, it is unlikely that a choice between two with regards to performance is going to make any difference to your application. I would suggest choosing the type whose api best suits your needs, making your code more readable, and easier to debug. TypedArrays would allow you to have consistent code at both client and server, while Buffers don't need to be initialised to zero. Each would have other pros and cons.
If performance did eventually become an issue, these types could also easily be swapped out, and separately profiled.