3 ms·
This node.js version is most certainly faster https://github.com/Weltschmerz/wsdemo/blob/master/competition/wsdemo.js https://github.com/Weltschmerz/wsdemo/blob
by Weltschmerz 14y ago
This node.js version is most certainly faster
https://github.com/Weltschmerz/wsdemo/blob/master/competition/wsdemo.js https://github.com/Weltschmerz/wsdemo/blob/master/competitio...
Wondering how much!
- kcbanner 14y agoHm, what performance impact does using arguments have?
- Weltschmerz 14y agoUsing .apply({}, arguments) is actually a bit slower, but either method is so fast that it won't be a bottleneck. I use it in this case for elegance, because I can. Note that in your original implementation this is impossible, because you have to access the "type" variable and use one of two methods (sendUTF or sendBytes). `ws` has only one method (send) and the parameters of this method match the arguments to the callback for on('message').