
Node.js vs Erlang: SyncPad's Experience - roder
http://blog.mysyncpad.com/post/2073441622/node-js-vs-erlang-syncpads-experience
======
Rauchg
It would be really useful for him to say what Node.js version he's using. Node
<=0.2.3 has a bug related to reaching the file descriptor limit of the OS that
makes CPU usage go through the roof, for example.

~~~
jerf
To be honest, though, this is the result you really should expect. Node.js is
a relatively new thing that is a bit of a clever hack on top of a language
runtime that is powerful but was not directly designed for this usecase,
running a language that is also powerful but not directly designed for this
use case. Erlang is a language that has been open source for 12 years (and was
actually started in 1986), both the language and the runtime are specifically
designed for this use case and has had years of tuning and bugfixes, and this
problem is right smack dab in the middle of what Erlang targets.

This isn't a criticism of Node.js... it's just the way it is. Every language
was young sometime.

(It will be interesting to see if Node.js ever quite catches up, though; when
you've really pushed the performance to the max for a given design decision,
you get down to the point where you can't improve without changing those
decisions. Erlang's GC, for instance, is absolutely written around having a
lot of threads that may be running on different CPUs, which adds a lot of
complexity that the V8 project, or any JS runtime project in general, may be
loathe to introduce into what is still fundamentally something that should be
able to go into a browser. But that's for the future to resolve.)

~~~
rbranson
Yes! This! Let's be reasonable adults about this: node.js and V8 are very new
projects that are really impressive given their age. OTP is an incredibly
mature and proven platform.

EDIT: If you're interested to really see what node.js's main issues are, check
out Ryan Dahl's (node.js creator) presentation at JSConf.eu 2010.
[http://jsconf.eu/2010/speaker/techniques_for_a_single_stack....](http://jsconf.eu/2010/speaker/techniques_for_a_single_stack.html)

EDIT (2): Yes, meant OTP, not OLTP. :)

~~~
gcampbell
Minor pedantry note: I think you mean OTP
(<http://en.wikipedia.org/wiki/Open_Telecom_Platform>), rather than OLTP
(<http://en.wikipedia.org/wiki/OLTP>).

------
boundlessdreamz
Google Cache:
[http://webcache.googleusercontent.com/search?q=cache:blog.my...](http://webcache.googleusercontent.com/search?q=cache:blog.mysyncpad.com/post/2073441622/node-
js-vs-erlang-syncpads-experience)

------
stcredzero
Why does JSON have to be involved at all? A binary format using UDP packets
would perform much better.

I was trying to use SyncPad with my dad last night to try out as a means of
doing Hangul lessons over the net, and performance was usable but
uncomfortably laggy.

~~~
dgreensp
It sounds like he tried to figure out how to process binary data with Node.js
using "Buffers" but didn't get it working before switching to Erlang.

------
nivertech
Why not combine both? Use Erlang/OTP for writing telecom-grade servers and
Javascript for embeddeded scripting engine. Both Riak and CouchDB do exactly
this. Use erlang_js OTP application:

{erlang_js,"Interface between BEAM and JS","0.4.1"}

------
joebo
The page is now showing "We'll be back shortly. Our servers are over
capacity". Now I'm really interested in which one they are currently using.

~~~
roder
tumblr :/

~~~
Xurinos
Interesting... Just a heads up if anyone cares: We had at least one tumblr
submission yesterday, too, that had trouble. Two days in a row might be a
larger red flag for tumblr or tumblr users.

~~~
slig
> Two days in a row might be a larger red flag for tumblr or tumblr users.

Twitter has been having this sort of problem since always. Users don't seem to
care about a little downtime.

~~~
silentbicycle
Hacker News itself has hiccoughs, too, but here we are.

------
jister
It's not because Node.js is a new thing. It just that JavaScript is a client
language, why would use it on a server anyway? Use the appropriate language
for your projects and in this case it's Erlang.

EDIT: For all those Node.js zealots, thanks for downvoting.

~~~
gnaritas
> It just that JavaScript is a client language

No, JavaScript is a language, it's been used on clients and servers for quite
a few years now.

~~~
jister
...and it's quite clear that using it on the server is not that efficient
compared to other languages that were designed to run on the server. The
article proves that point.

~~~
gnaritas
I'm afraid you've confused a language with a particular virtual machine that
runs it. That's like criticizing CSS because Internet Explorer implements it
badly. The article proves nothing other than one particular JavaScript VM
isn't as efficient as Erlang, not exactly a big surprise considering that's
not what the VM was written for.

