Live data from Hacker News

uWebSockets: Scalable WebSocket server library for Node.js and C++11

github.com

51–60 of 87 posts

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#51
post #47

Earlier quoted context omitted.

Humility and a collaborative attitude are really important to get the best results. When people attack your code, it isn't an attack on you. It makes your code better. It's one of the downsides to releasing any opinionated project (and many good projects are opinionated). For my part, I won't use software written by someone who doesn't either refute criticism or use it to improve code, and I'm not satisfied you're do…

According to logic, this quote "yeah - the C++ bits were clearly written by someone who doesn't know the language well. I'd be careful about using this code in production." is a personal attack. I get offended by this, personally. When I get offended, personally, I answer how ever I see fit. Thank you, you will be missed. I don't know what to do without you.

That's the kind of stuff that he is talking about...

The snark and sarcasm makes you look incredibly incompetent, and I don't want to touch your code because of it (after all, if you are part of my dependency chain, then you have the ability to sneak in updates, and if you can't even be civil in a comment thread, how do I know you won't attack me through code?).

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#53
Hey there. Just wrote down a few things that came to my mind after seeing this. Don't see it as criticism, but as a few hints/remarks what has to be covered by a websocket (or any other protocol) implementation. Imho the high performance part isn't too hard to achieve and shouldn't be the highest rated. The important thing is that such a server should be rock solid in implementation, otherwise it's worthless.

Some things that you should answer if you are offering this as a C++ websocket library, and which are currently not covered in the header file:

    - Whats the threading model of the library?
    - Will server.run() start a singlethreaded eventloop (I guess so from taking a supershort peek into the code and seeing libuv) and everything is running inside there or will it start multiple worker threads?
    - Based on the last question, from which thread[s] are the other callbacks called.
    - If multiple threads are used, is the library threadsafe for sending messages from other threads
    - Is it integratable in other eventloops? Most applications already have a mainloop or something like this, libraries which only work with their own mainloop are not very useful. Normally applications also have to deal with other application logic besides responding to websocket messages.
Besides that a few general questions that you should be able to answer for a websocket implementation:

    - What's the sending behavior of socket.send?
    - Will it block until all data was sent? This can cause problems with slow receivers in singlethreaded environments.
    - Will it copy all data and buffer it internally until it can be sent? This provides no means for backpressure and slow receivers (or non-receivers) can exhaust the servers memory.
    - Does it handle connection close properly? This is unfortunatly not too easy in websockets.
    - And are there timers in place for force closing the connection if the shutdown sequence is not completed properly? Or if the initial handshake is not completed in a given timeframe?
    - Does ist handle control frames? And will it merge control frames (PONGs) if multiple are queued before they are sent? And will it stop sending them after close connection is initiated?

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#54
post #47

Earlier quoted context omitted.

Humility and a collaborative attitude are really important to get the best results. When people attack your code, it isn't an attack on you. It makes your code better. It's one of the downsides to releasing any opinionated project (and many good projects are opinionated). For my part, I won't use software written by someone who doesn't either refute criticism or use it to improve code, and I'm not satisfied you're do…

According to logic, this quote "yeah - the C++ bits were clearly written by someone who doesn't know the language well. I'd be careful about using this code in production." is a personal attack. I get offended by this, personally. When I get offended, personally, I answer how ever I see fit. Thank you, you will be missed. I don't know what to do without you.

Hey man, don't let them troll you.

When reading your comments and code on the web, it seems like you're really an awesome dev, but you give in to hate comments by such people too easily.

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#55
post #47

Earlier quoted context omitted.

Humility and a collaborative attitude are really important to get the best results. When people attack your code, it isn't an attack on you. It makes your code better. It's one of the downsides to releasing any opinionated project (and many good projects are opinionated). For my part, I won't use software written by someone who doesn't either refute criticism or use it to improve code, and I'm not satisfied you're do…

According to logic, this quote "yeah - the C++ bits were clearly written by someone who doesn't know the language well. I'd be careful about using this code in production." is a personal attack. I get offended by this, personally. When I get offended, personally, I answer how ever I see fit. Thank you, you will be missed. I don't know what to do without you.

It has been said posting code on HN a literal "Trial By Fire",

But reading the comments in this thread this has gone overboard....to the point I, as a casual observer, had to say something.

I agree, "clearly written by someone who doesn't know the language well", _IS_ a direct attack on the developer and not the code. And I couldn't comprehend the mental gymnastics it would take to explain otherwise.

There is a major difference between:

"Why did you implement your own Queue here?" and "This guy doesn't understand C++. Don't use his code."

Don't let them win by giving into replying with a "Redditor" form of rebuttal filled with snark.

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#56
post #47

Earlier quoted context omitted.

Humility and a collaborative attitude are really important to get the best results. When people attack your code, it isn't an attack on you. It makes your code better. It's one of the downsides to releasing any opinionated project (and many good projects are opinionated). For my part, I won't use software written by someone who doesn't either refute criticism or use it to improve code, and I'm not satisfied you're do…

According to logic, this quote "yeah - the C++ bits were clearly written by someone who doesn't know the language well. I'd be careful about using this code in production." is a personal attack. I get offended by this, personally. When I get offended, personally, I answer how ever I see fit. Thank you, you will be missed. I don't know what to do without you.

You obviously have strong options about this. That said let me offer you a bit of advice.

I don't care how good your code/framework is if you blow up on just a minor bit of criticism. This is a great example where some comments in code could help teach people who don't know better.

Long gone are the days where the solo programmer could make important software without interacting with the rest of the outside world. Knowing when to check your ego at the door is just as important as getting the technical bits right.

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#58

Earlier quoted context omitted.

> usage of raw pointers, unchecked pointer arithmetic, goto for flow control and raw new/delete calls But without all that you would lose performance which seems to be the main goal of this project.

Yes, I use uv_poll_t instead of uv_tcp_t because of massive memory and performance differences. Every decision made, has been made from a performance perspective.

I'm interested in what you've learned using libuv while tuning this library. I've read in the past that libuv makes a lot of unnecessary memory allocations. Is this true and/or have you consider writing directly to select/epoll/kqueue? Is there a lot of overhead in using libuv vs the OS provided eventing syscalls?

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#59

This looks awesome. Can I use this with Meteor? If there is any app that would benefit from websocket optimizations it's Meteor.

I don't think so but Meatier ( https://github.com/mattkrick/meatier ) should receive uws as default engine since it build on SC, you could look into that but honestly I don't understand this project at all :P

Not sure it it helps but it looks like it uses Faye-Websockets

https://github.com/faye/faye-websocket-node

I don't know enough about the inner workings to be able to tell if it's compatible. Any Speeding up of meteor would be HUGE news.

Post reply on HN