JavaScript Array-Looping Speed Test
It’s been said over and over again that the standard method of looping through array items in JavaScript (the for loop) is not very efficient. I wanted to check this for myself so I ran three implementations of array loop through the firebug profiler. While testing only in FireFox 4 is certainly not anything resembling scientific, I believe the drastic differences between execution times is quite telling, and can be considered definitive.
JavaScript String Concatenation Speed Test
One performance recommendation I’ve seen was about concatenating really long strings. Unless you are using bits of JavaScript to prettify your pages, AJAX+DHTML web apps use tons of these long strings as templates, just as a server-side web framework would do. Unfortunately, JavaScript has no support for multiline strings, so we end up using multiple single-line strings, and concatenating them one way or the other. As these stings are very long, and abundant, it makes sense to make string concatenation as fast as possible.
Blocking vs Non-blocking: Node vs Bottle
Node.js boasts real-time performance. Of course, depending on hardware, it may show some level od delay in responses, but it is usually able to handle requests as soon as they come in. I have built two simple hello world apps, one running on top of Node.js, and one running on top of Bottle/Bjoern. Bjoern is a non-blocking WSGI server written in C, and it should perform very well on its own, but Python is blocking, so we want to see how it stacks up against a pureluy non-blocking app written on Node.js.
Profilejs: V8 profiling for Express framework
I’ve started using Danny Coates’ node-inspector recently. It works very well as a graphical debugger (runs in a webkit browser), and it can also serve as a profiler in conjunction with v8-profiler.
I wanted a tool that would profile all requests for me, so I could browse and pick through the logs afterwards, but I couldn’t find one. So I decided to write a middleware for Express that would pipe all requests throug the v8-profiler. The result is Profilejs.




