In association with heise online

26 June 2012, 11:51

Node.js 0.8 performs at a higher tempo

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

Node.js logo The developers of Node.js, the popular server-side JavaScript platform, have announced the release of a new stable version, 0.8. The new version offers improved performance, a more stable API, a new build system, a "much more awesome" cluster module and a new domain module. Node.js offers an event-driven, non-blocking platform for running JavaScript applications on servers and has become the foundation for a number of other platforms including Opa and Meteor.

The performance improvements in Node.js are based around an updating to version 3.11.10.10 of the V8 JavaScript engine which is found at the the heart of Node, and enhancements to libuv, the platform layer for Node. Together these result in improved read and write performance for networking and files. Libuv was introduced in version 0.6 of Node.js, transitioning from libev and libeio to get cross-platform support, and as such somewhat reduced the stability of the platform. The transition from 0.6 to 0.8 though should be a lot simpler and the entire platform benefits from being simpler and more efficient. There have been some API changes though and these are detailed in the project's wiki.

One thing that was lost in the transition from 0.4 to 0.6 and libuv was the ability to listen to file descriptors. This allowed applications to listen to sockets or ports but went away in 0.6, with the most common use case, listening for other node.js processes, being handled by the cluster module. But many other use cases were not handled; now in 0.8, this functionality has returned with a new server.listen(fd) call. It is also possible to pass file descriptors to child processes to allow those children to inherit the already open file descriptors, including stdio.

The cluster module also got a complete rewrite for 0.8; the developers say it is mostly backwards compatible with 0.6 and applications will now be faster and "more well-behaved". A new module, Domains, has also been added on an experimental basis – this allows IO operations to be handled as a single group, specifically when one of the operations throws an error. The design is described as a first pass at the problem, but for those interested, details and examples are available in the API documentation.

WAF, an SCons-like Python-based build system, has been used for Node.js since inception, but version 0.8 sees a switch to GYP (Generate Your Project), following the path the Chrome project has recently taken. GYP generates Makefiles, Visual Studio or Xcode files, dependent on target, and allows the Node to better integrate with the native build system on platforms and with V8's build process. Other changes include a facelift for the Repl, Readline and TTY modules, making them easier to use when debugging programs.

Node.js 0.6 will continue to be maintained with critical bugfixes and security fixes through to the end of 2012, but development attention has moved now to the 0.8 release and, in a few weeks, the new unstable branch 0.9. The 0.9 branch is scheduled to see the HTTP implementation, Streams API and Libuv streams become the focus of clean up and refactoring. Beyond there, SSL performance and the Crypto API are among the future targets for work.

Node.js 0.8.0 is available to download as a Windows installer, Mac OS X installer or as source code. The MIT licensed Node.js (full licence details) is also available from the project's Github repository and should be available for a number of Linux platforms through their package managers soon.

See also:

(djwm)

Print Version | Send by email | Permalink: http://h-online.com/-1626149
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit