18 comments

[ 3.3 ms ] story [ 48.2 ms ] thread
This post is interesting, and I am interested in Clojure. But I'd like to see some more posts about real-world Clojure usage.
Hopefully this will get more people interested in Clojure; more and better content should follow.
I wonder if other JVM languages, e.g., Scala, would have the same performance in the "Hello World" test cited in the article.
(author here) I have the same question. We'd love someone to do it (esp. a Scala pro) and send us a pull request.
If you're going to benchmark, I recommend that you benchmark with the most common Clojure web setup - Ring + Jetty.
In fairness to the author, he only used event driven servers everywhere. The default assumption would probably be that this was the highest throughput approach, but ignores the sheer maturity of Jetty vs Aleph. I doubt the numbers for ruby would be as good if he'd used WEbrick.
jetty uses non-blocking i/o internally as well, just by the time it hits the servlet layer it's thread/request.
I'm the author of Aleph, the Clojure web server being benchmarked.

The most recent release of Aleph has focused on adding instrumentation and support for easily creating asynchronous workflows. A lot of new abstractions have been introduced, and "Hello World" performance has suffered a bit as a result.

However, now that all this has been introduced (0.2.0 is very close to release), I'm planning a "tick" release [1] that will focus on regaining some of the lost performance.

So please don't judge Clojure's potential for performant Hello World servers by what Aleph can do right now.

[1] http://en.wikipedia.org/wiki/Intel_Tick-Tock

thank you for informing the numbers, I get much better results with straight ring and jetty through clojure, so it's annoying to see 'clojure is exactly this slow relative to the others'
I'm thinking that ultimately, you're testing two different things here. Language speed is part of it, but also the performance of your web server library.

I'm not saying it's unfair or meaningless, but it's worth bearing in mind that, for instance, the node.js web server is mostly written in native code, while the clojure web server is written in Clojure. For a large program, I imagine that node would get slower and slower, and Clojure and Scala would get faster and faster.

It's hard to know what you're actually testing without profiling. My guess is it's only the overhead of netty and lamina at play here, and not clojure itself. There are profiling facilities to know for sure, and the author should try to check that out. I can get like 8k request/s from clojure with jetty last time I tried.
If anyone is looking for a (very slightly) larger Clojure web app to poke around in, I rolled an example Noir app together a few weeks ago:

https://github.com/pmn/noir-messageboard

It doesn't do much, but it does do more than the usual "Hello World" style apps.

Thanks for sharing. I'm coming up to speed with Noir myself, and it's very helpful to see how others are building their websites with it.
I'm surprised that this landed on the front page. What's the point of benchmarking hello world in the first place? Not to mention that data collected from a single ab run with a fixed concurrency number is not significant in any way.