Live data from Hacker News

Concurrency in Ruby almost as good as Node.js

openhood.com

11–20 of 34 posts

Re: Concurrency in Ruby almost as good as Node.js

#11

This is great work but...please redo the charts to start at Zero and end at 50,000 to keep things consistent and prevent Edward Tufte from killing a kitten if he ever sees your charts.

Also, you probably want to put the things you are comparing on the same chart.

Re: Concurrency in Ruby almost as good as Node.js

#12

Yes the nodejs concurrency model takes some time getting used to, but working with threads is much harder imo. Raw speed benchmarks don't do enough to give a full picture.

EventMachine uses an event loop like node, so threads are somewhat irrelevant here. Unless "workers" are threads and not actual processes, but I am pretty sure they are processes.

Re: Concurrency in Ruby almost as good as Node.js

#13

Yes the nodejs concurrency model takes some time getting used to, but working with threads is much harder imo. Raw speed benchmarks don't do enough to give a full picture.

This is comparing nodejs with Ruby's EventMachine, so where do threads enter the picture? It's been a while since I looked at EM, but if I remember correctly, it's pretty much in the same area as Python's Twisted or node.js, as opposed to something like plain ol' Java threads or Erlang.

Re: Concurrency in Ruby almost as good as Node.js

#14
post #9

Hey, look, requests/s on a synthetic benchmark. Let's not look at things like thread safety, resource consumption, average/best case/worst case latency, quality of available libraries and their support for concurrency, or code quality/maintainability issues. Meh. At least he provided the source code and plenty of data. That's cool.

I await your proper and full analysis, or a link to one.

I don't think we are required to provide a better analysis in order to point out the problems with a flawed one.

Whatever the author is measuring here, it's most certainly not "node" vs "ruby". This should be obvious when you look at the test-apps that he's using (which involve mongodb and serialization).

Re: Concurrency in Ruby almost as good as Node.js

#15
This is not a Ruby vs Node.js benchmark because Node.js is still a layer above the V8 Javascript engine. Moreover Node.js was optimize for things like concurrency and this is similar to what eventmachine is optimized for. The difference is node.js makes the event model a language construct. I think it would have been better to use eventmachine but you did not because:

> At first I tried to compare bare node.js against eventmachine_httpserver. It did quickly became obvious that this kind of micro-benchmark wasn’t going to be very helpful in deciding which one to choose.

Your first observation was the correct one. The best thing to do is just pick a language and go with the best tools available.

Re: Concurrency in Ruby almost as good as Node.js

#17

Yes the nodejs concurrency model takes some time getting used to, but working with threads is much harder imo. Raw speed benchmarks don't do enough to give a full picture.

Threads are inferior to events for concurrency, but they're better for throughput.

number_of_threads * thread_stack_size = sadface.jpg (when trying to use threads to handle lots of connections)

Re: Concurrency in Ruby almost as good as Node.js

#18
I just can't resist, Serbs have saying 'almost is what makes girl unhappy' :).

On more serious note, ruby is definitely better when it comes to richness of available libraries which is what node is missing. I think in real life node can handle more, I heard that issues with memory leaking are solved, probably uses less memory as well. I agree with conclusion that both are more then capable or handling async problems, I would use event machine on ruby end, this whole example seems flawed a bit. Anyhow, thanks for posting your results.

Re: Concurrency in Ruby almost as good as Node.js

#19
post #14
post #9

Earlier quoted context omitted.

I await your proper and full analysis, or a link to one.

I don't think we are required to provide a better analysis in order to point out the problems with a flawed one. Whatever the author is measuring here, it's most certainly not "node" vs "ruby". This should be obvious when you look at the test-apps that he's using (which involve mongodb and serialization).

It's very easy to complain, cast stones, etc. I don't think I've seen a benchmark on HN or reddit where many of the comments were not smug complaints. Yet, I've never seen any of the complainers produce a benchmark with the exception of zedshaw and one other person whose name I've forgotten.

Re: Concurrency in Ruby almost as good as Node.js

#20
But node.js doesn't have any concurrency. It's single-process, single-threaded and event driven, so by definition it's not concurrent. It's just not blocking.

Also, was someone really trying to run performance benchmarks on a shared machine running on a VM and expecting to get anything meaningful out? Really? Like really? I'm embarrassed for you.

Post reply on HN