Re:Node.js Versus LUA "Hello World" HTTP Server Showdown
by mrb on Sunday October 17, 2010 @07:27AM
(#1800115)
The difference with the original script is, as I said, that mine does NOT call setEncoding (if you call setEncoding, node will decode Buffers to strings, thereby wasting CPU time). My 47% faster number comes from benchmarking node.js+net against my optimized version (both on my machine).
[ Parent
| on HN ]
Re:Node.js Versus LUA "Hello World" HTTP Server Showdown
by simonhf on Sunday October 17, 2010 @11:38AM
(#1800549)
Hmmm... I'm confused because my node.js+net script also doesn't call setEncoding() and looks the same as your node.js+net script. The node.js+net+crcr script of yours is a nice optimization though on my test box it reaches 23,224 queries per second.
We are getting closer to open sourcing SXELua :-) It would be great if we could think up a better benchmark then the "Hello World" benchmark :-) What do you think about the suggestion described higher up in this thread?
Re:Node.js Versus LUA "Hello World" HTTP Server Showdown
by mrb on Sunday October 17, 2010 @03:34PM
(#1801172)
I see. I must have gotten confused somewhere then. node.js+net+crcr was calling setEncoding, but you are indeed not calling setEncoding in node.js+net...
I think the ideal is a bunch of little synthetic benchmarks, similar to the Hello World, plus a handful of real-world examples like the one checking a password. You want something that stresses the CPU / RAM (not network), since that's where the interesting differences are between these scripting environments.