Live data from Hacker News

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

toptal.com

41–50 of 59 posts

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

#41

Pet peeve: tech articles/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. I can't tell when this was written, am I missing something?

My best guess would be 7 months ago (~ May 11th 2017), since most comments were made at that time.

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

#42
post #30

Earlier quoted context omitted.

Same with Php, using really old versions of it. This is a waste of time article, nothing is learned from it appart the bias of the author.

Ummmm when you care about I/O performance and your building anything of substance (something more than what nginx can do on it's own) why would you choose PHP? The security, fragility and un-maintainability alone are enough reasons to avoid it.

I'm not promoting php's use, just pointing out how benchmarking against a years old of anything is pretty useless. Which is another indicator the article was of low value and interest, providing no real, meaningful insight into those different languages.

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

#43
post #8

I was reading the article until a giant fullscreen ad popped up and I had to close the tab. Sorry, no thanks.

Disable javascript and you won't see any ads. Sometimes you don't see anything at all, true, but in those cases the close- or back-button quickly solves your problems.

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

#45
post #31
post #4

Earlier quoted context omitted.

No, it's not the only thing that matters. Java's compiled too and was included here, but Go still beat it out. It's likely that C or Rust or C++ would be much faster than Java or Go since they have large runtime overheads; it turns out having a runtime and how heavy it is matter too, not just if it's compiled. There are also cases where non-compiled languages can beat out compiled ones. For example, lua with LuaJIT i…

Java is compile to bytecode which is then interpreted by a virtual machine, it's not compiled to native code, that's why you cannot distribute Java programs as executable like go.

Java has a JIT that will compile to machine language during run time.

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

#47

Earlier quoted context omitted.

https://nikhilm.github.io/uvbook/filesystem.html > The libuv filesystem operations are different from socket operations. Socket operations use the non-blocking operations provided by the operating system. Filesystem operations use blocking functions internally, but invoke these functions in a thread pool and notify watchers registered with the event loop when application interaction is required.

I'm not familiar with libuv but is there a dedicated "watcher" thread in a thread pool that the kernel wakes up when when the disk driver has completed that I/O that it was sleeping on? If so is there a dedicated "watcher" thread for each non-blocking I/O request handled by libuv?

There is no watcher: threads get parked by the kernel as "not runnable" while they perform the I/O operation.

When the operation is finished, then they become runnable again so the kernel scheduler runs them--that is, it runs the code that comes after the I/O operation.

This code (from libuv) notifies the requester that the operation is complete.

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

#49
post #31
post #4

Earlier quoted context omitted.

No, it's not the only thing that matters. Java's compiled too and was included here, but Go still beat it out. It's likely that C or Rust or C++ would be much faster than Java or Go since they have large runtime overheads; it turns out having a runtime and how heavy it is matter too, not just if it's compiled. There are also cases where non-compiled languages can beat out compiled ones. For example, lua with LuaJIT i…

Java is compile to bytecode which is then interpreted by a virtual machine, it's not compiled to native code, that's why you cannot distribute Java programs as executable like go.

Sure you can, https://www.excelsiorjet.com/

Java has a specification and has lots of implementations.

The majority of commercial implementations of Java have native code compilers, and Oracle is in the process of improving the AOT compiler introduced in Java 9.

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

#50
post #31
post #4

Earlier quoted context omitted.

No, it's not the only thing that matters. Java's compiled too and was included here, but Go still beat it out. It's likely that C or Rust or C++ would be much faster than Java or Go since they have large runtime overheads; it turns out having a runtime and how heavy it is matter too, not just if it's compiled. There are also cases where non-compiled languages can beat out compiled ones. For example, lua with LuaJIT i…

Java is compile to bytecode which is then interpreted by a virtual machine, it's not compiled to native code, that's why you cannot distribute Java programs as executable like go.

Is there a way to bundle the JVM (or the parts you need) with the Java app you'd like to run? Erlang (and Elixir) does this with the Erlang VM (BEAM), allowing you to bundle VM+app as a release. The Erlang release must be compiled for the platforms on which that release will be run. It's not quite as elegant as a Go binary, but it's still pretty handy.
Post reply on HN