TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Server-Side I/O Performance: Node vs. PHP vs. Java vs. Go

69 pointsby vgallurover 7 years ago

17 comments

jwlakeover 7 years ago
The article talks about IO, but then benchmarks sha256. The node program doesn&#x27;t work well because he&#x27;s synchronously doing this:<p><pre><code> for (var i = 0; i &lt; n; i++) { sha256(data); } </code></pre> He should be using crypto and the async versions. This benchmark actually is just measuring the speed of your sha256 implementation, which I would guess is equal on all 4 platforms if you actually do them correctly.
评论 #15915909 未加载
评论 #15916166 未加载
glitcherover 7 years ago
Pet peeve: tech articles&#x2F;blogs which do not prominently display when the article was written. This is the single most important fact I search for before reading time sensitive tech info.<p>I can&#x27;t tell when this was written, am I missing something?
评论 #15919582 未加载
评论 #15916210 未加载
评论 #15916628 未加载
评论 #15916438 未加载
ninkendoover 7 years ago
I was reading the article until a giant fullscreen ad popped up and I had to close the tab. Sorry, no thanks.
评论 #15916051 未加载
评论 #15916701 未加载
评论 #15917019 未加载
exabrialover 7 years ago
I&#x27;m curious, which Java servers are creating a new Thread per request?<p>Tomcat uses acceptors threads and a request executor pool. And, if available on your platform (which it probably is), it defaults to using non-blocking IO instead of polling.<p>EDIT: It looks like he does acknowledge the executor threads are pooled. His main criticism is that &quot;too many blocked threads are bad for a scheduler&quot;. But if Tomcat is using the NIO connector this doesn&#x27;t apply, because your executor threads won&#x27;t block on IO. And typically the pool size is limited to something manageable by a modern CPU (200 or so)
评论 #15916287 未加载
评论 #15915992 未加载
pjmlpover 7 years ago
So he acknowledges that has not benchmarked the best options for Java and then selects Go as a winner, what a joke.
评论 #15916518 未加载
评论 #15916338 未加载
评论 #15916193 未加载
TheDongover 7 years ago
The ease of use chart is a joke:<p><pre><code> Java: Requires callbacks nodejs: Requires Callbacks </code></pre> node has &#x27;await&#x27;, but there are other options as well than just plan callback hell.<p>Java has pretty much whatever you want. Akka, futures&#x2F;promises, etc.
flavio81over 7 years ago
&gt;<i>Before I get into the section for Go, it’s appropriate for me to disclose that I am a Go fanboy</i><p>Yes, it shows...
mtgxover 7 years ago
I visited the post fully expecting the author would benchmark the latest PHP 7.2. To my surprise, he wasn&#x27;t even benchmarking 7.0, but the old 5.6. I can&#x27;t take this test seriously.
评论 #15916010 未加载
评论 #15916348 未加载
评论 #15915814 未加载
dingdingdangover 7 years ago
PHP 5.6.x and old version of Node too - this article is too old to be of serious use.
dullgiulioover 7 years ago
The example of async I&#x2F;O in Node.js is with a filesystem operation.<p>How does that work? AFAIK Linux, unlike windows, doesn&#x27;t have a proper async API for filesystem I&#x2F;O.<p>POSIX AIO is implemented using threads in libc and Linux AIO (io_submit, etc) only works with O_DIRECT (no kernel caching) and there are other issues depending on underlying filesystem driver.<p>Is there any solution?
评论 #15915639 未加载
评论 #15915635 未加载
ruffreyover 7 years ago
While still suffering from the problem of benchmarks not reflecting real world performance, The Computer Language Benchmarks Game is an excellent resource.<p><a href="http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org" rel="nofollow">http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org</a>
评论 #15933167 未加载
frugalmailover 7 years ago
He&#x27;s using the slowest and oldest framework on Java which still is preferable to use if you want things easy to read and maintain. But if you&#x27;re going for raw I&#x2F;O performance and already taking the readability and maintenance challenges with the other platforms, then he really should be using Netty, Vert.x or Akka for Java.
politelemonover 7 years ago
This post seems to be from about 7 months ago. Do the &#x27;turbofan&#x27; changes of v8&#x2F;v9 make any difference to the benchmarks?<p><a href="https:&#x2F;&#x2F;www.nearform.com&#x2F;blog&#x2F;node-js-is-getting-a-new-v8-with-turbofan&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.nearform.com&#x2F;blog&#x2F;node-js-is-getting-a-new-v8-wi...</a>
haglinover 7 years ago
What a lousy article.<p>&quot;Most Java web servers work by starting a new thread of execution for each request that comes in &quot;<p>Nobody who has a performance critical application starts a new thread for every request.<p>That would be beyond stupid.
Neil44over 7 years ago
He’s using Apache in prefork mode with mod_php, which is a little bit 10 years ago. Worker or Event with php-fpm is standard now.
bullenover 7 years ago
Only Java can share memory between threads.
callesggover 7 years ago
Line for line Go will be faster it is compiled.<p>It is the only thing that matters line for line.
评论 #15916109 未加载
评论 #15915516 未加载