Live data from Hacker News

Vert.x (JVM async) vs Node.js Http benchmarks results

vertxproject.wordpress.com

111–120 of 122 posts

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#111
post #90

Earlier quoted context omitted.

> Node.js is not a fad. It represents the first workable JavaScript-based server with mass appeal. The real story is that JavaScript is here to stay. Javascript yes. Node.js, not so much. >There have been other server-side JavaScript frameworks in the past, but none of them have taken off like Node.js. Javascript was not a fast language in the past, nor was it much used for anything more than the most basic dynamic h…

> nor was it much used for anything more than the most basic dynamic html stuff You seem to have missed Netscape Enterprise Server (1994), HaXe, Helma, AppJet, Aptana Jaxer, Narwhal/Jack, EJScript, RingoJS, Flusspferd, and ASP.

No, the industry seem to have missed them. None of those were any big success.

(With the exception of ASP. But in ASP, Javascript was just one of the languages you could use, and not the most popular one).

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#112
So a quick verification. The io is the difference between these two. The JVM is doing some caching somewhere, whereas the v8 engine is not. Making a small change to both (in order to ensure that both are using the exact same logic):

https://gist.github.com/2652991

and then I get the following results:

vert.x:

39890 Rate: count/sec: 3289.4736842105262 Average rate: 2958.1348708949613 42901 Rate: count/sec: 2656.924609764198 Average rate: 2936.994475653248 45952 Rate: count/sec: 3277.613897082924 Average rate: 2959.610027855153

node.js:

38439 Rate: count/sec: 4603.748766853009 Average rate: 4474.62212856734 41469 Rate: count/sec: 4620.4620462046205 Average rate: 4485.278159589091 44469 Rate: count/sec: 4666.666666666667 Average rate: 4497.515122894601

Making that change so they both store the file in memory and nodejs is 50% faster than vert.x.

This is using an m1.small instance on EC2, and both vert.x and nodejs only using a single core.

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#113

So a quick verification. The io is the difference between these two. The JVM is doing some caching somewhere, whereas the v8 engine is not. Making a small change to both (in order to ensure that both are using the exact same logic): https://gist.github.com/2652991 and then I get the following results: vert.x: 39890 Rate: count/sec: 3289.4736842105262 Average rate: 2958.1348708949613 42901 Rate: count/sec: 2656.924609…

Yea. There is no way java/rhino could beat c/v8.

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#114

So a quick verification. The io is the difference between these two. The JVM is doing some caching somewhere, whereas the v8 engine is not. Making a small change to both (in order to ensure that both are using the exact same logic): https://gist.github.com/2652991 and then I get the following results: vert.x: 39890 Rate: count/sec: 3289.4736842105262 Average rate: 2958.1348708949613 42901 Rate: count/sec: 2656.924609…

Yea. There is no way java/rhino could beat c/v8.

In any case even if it was faster, it wouldn't be an order of magnitude faster. That kind of a difference should be an indication that something is wrong with the benchmark.

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#115
post #2

Interesting results. While it's not surprising to me that the pure java implementation was far and ahead better since: 1.) Java's much faster than Javascript, and 2.) Netty (which Vert.x is based on), has been doing high performance async IO for years before node even existed in extremely high performance environments. What is surprising however, is that javascript on the JVM w/ vert.x is faster than V8 with node. In…

Using this benchmark: https://gist.github.com/2652991

nodejs beats Vert.x for example. People shouldn't be so quick to accept these half thought out microbenchmarks.

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#117

Earlier quoted context omitted.

I had the impression that "Node.js (readfile)", and possibly "Node.js" meant the blocking call but that "Node.js (streams)" meant he was using something like fs.createReadStream(). But you're right, I don't see that anywhere in the posted source.

I've tested several combinations of blocking, non blocking, readFile, streams (pipe) and using chunked transfer encoding. Results vary a little but all way below the Vert.x results. See blog post for the stats.

Fair enough. After I wrote that I remembered that readFile wasn't blocking anyways, but it was too late to edit at that point.

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#118

So a quick verification. The io is the difference between these two. The JVM is doing some caching somewhere, whereas the v8 engine is not. Making a small change to both (in order to ensure that both are using the exact same logic): https://gist.github.com/2652991 and then I get the following results: vert.x: 39890 Rate: count/sec: 3289.4736842105262 Average rate: 2958.1348708949613 42901 Rate: count/sec: 2656.924609…

The JVM does not doing any caching.

And artificially crippling Vert.x to a single core does not prove anything. Anybody who cares about performance will be using more than one core.

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#119
post #43
post #2

Interesting results. While it's not surprising to me that the pure java implementation was far and ahead better since: 1.) Java's much faster than Javascript, and 2.) Netty (which Vert.x is based on), has been doing high performance async IO for years before node even existed in extremely high performance environments. What is surprising however, is that javascript on the JVM w/ vert.x is faster than V8 with node. In…

I would also be interested in the internals. I'd expect JS + a small C event loop to outperform compiled JVM code + lots of async Java I/O libs (for a micro benchmark, at least). But there's no question Netty is fast even on a non-benchmark. I'm using it for a long-polling server with upwards of 100K connections, and my CPU doesn't go much over 5%. Besides memory usage, the main limitation has been proper kernel conf…

I was surprised. We built 'hellod' servers in numerous languages and with various runtime stacks[1]. The results are here and might surprise you:

https://github.com/carbonfive/hellod/blob/master/results.md

[1] C/libev, Clojure/Aleph, Clojure/Jetty, Erlang, Go, Java/Netty, Java/NIO, node.js, JRuby, MRI Ruby

Re: Vert.x (JVM async) vs Node.js Http benchmarks results

#120
post #71

Earlier quoted context omitted.

Node's API is async. Under the hood everything is done via threadpools, same as in Java or any other stack. Your hardware knows how to run threads; that's all. Whether or not that's what's exposed to you as a programmer is a different story. You don't actually get a performance boost from Node being "async". Node's async abilities simply give you transparent access to threads that are otherwise unavailable with javas…

Umm, hardware knows NOTHING about threads. Threads give you a very fake view of the hardware. Everything about threads is an emulation over the hardware layer, hence why they have a large memory overhead.

The CPU is aware of a thread's instruction pointer and stack pointer (that's how some CPUs are able to support hyperthreading). Perhaps it's possible that the OS could somehow manipulate that to implement threads that are not as heavyweight as "common" threads, but I'm not aware of any OS that does that. Threads are the only multiprocessing abstraction provided by the CPU and the OS (although now there are some new abstractions for GPUs).
Post reply on HN