Closed szmarczak closed 6 years ago
PascalCase is life. You'll only need to use these functions once per application, a bit more typing is fine.
It should probably be around the same speed, I don't have time to test, but there are a few areas in which it could be made a bit faster.
I tested performance a bit using uWS's benchmark programs in a not very scientific way, and throughput looks about 1/3 as fast as uWS. Plenty of room for improvement.
I implemented corking, and it seems to be at about the same level of performance as uWS now, in their benchmarks. I didn't test for very long so there's definitely some noise in the results.
- PascalCase is life. You'll only need to use these functions once per application, a bit more typing is fine.
Can't argue with that. Different people have different likes :P
I implemented corking, and it seems to be at about the same level of performance as uWS now, in their benchmarks. I didn't test for very long so there's definitely some noise in the results.
Sounds awesome!
I've played with this lib a bit, I love it!
Also, I won't be optimizing further for uWebSockets benchmarks. Their benchmarks don't really test what I use websockets for. For example, corking/uncorking during the parsing of packets helps a lot in their echo benchmark (3x performance), but not nearly that much in my (and possible other) applications (since I don't usually send replies inside the callback for OnClientData).
I think a more realistic benchmark would be opening 10k connections and the server would have to send packets with random data with length 40~500 bytes as fast as it can to each connection (not the same random data to all connections).
It's not too hard to implement (as in, probably <10 lines), but I don't use anything but GET requests on those websocket servers, so whoever wants it can make a pull request if they need it now.
This doesn't really affect library consumers very much. C++17 isn't very well supported on Windows and older versions of other OSes.
I won't be optimizing further for uWebSockets benchmarks.
I do async jobs too :)
I think a more realistic benchmark would be opening 10k connections and the server would have to send packets with random data with length 40~500 bytes as fast as it can to each connection (not the same random data to all connections).
Agreed.
- [...] whoever wants it can make a pull request if they need it now.
Ok, will do! 😃
- [...] C++17 isn't very well supported on Windows and older versions of other OSes.
Oh, that's sad. Who stores servers on Windows nowadays? :o
SetClientConnectedCallback:
onConnection
SetClientDisconnectedCallback:onDisconnection
SetClientDataCallback:onData
SetHTTPCallback:onHTTP
or more like JavaScript WebSocket -
onOpen
,onClose
,onMessage
...