Paul Krill
Editor at Large

Microsoft adds multithreading to Node.js for compute-heavy apps

news
Oct 23, 20172 mins

The Napa.js runtime is in development to bring C++-like performance to Node.js

thread weave spools diverse colorful sew2
Credit: Thinkstock

Microsoft’s beta Napa.js runtime is offering multithreaded support for the Node.js server-side JavaScript platform, to provide the flexibility of JavaScript with speedy performance akin to C++’s.

By introducing multithreading to Node.js, the Napa.js runtime can more easily handle computation-intensive tasks, Microsoft said.

Built on the same V8 JavaScript runtime as Node.js, Napa.js can be embedded in a host process without Node.js dependency. It can be installed via NPM by typing npm install napajs.

The Node.js Foundation, which oversees the development of Node.js itself, sees Napa.js as part of the Node.js ecosystem, addressing a use case that complements Node.js by providing a way to run multithreaded JavaScript processes for computationally heavy uses cases.

Napa.js also has:

  • A Node.js-compatible module architecture with support for NPM.
  • An API for object transportation, object-sharing, and asynchronous processing capabilities on JavaScript threads.
  • An API for pluggable logging, metric, and memory allocation.

Microsoft’s Napa.js plans include:

  • Performance improvement through support of a pluggable memory allocator and minimization of garbage collection impact on execution latency.
  • Node compatibility.
  • Installation, including complete support for embedded scenarios.
  • Cooperation between JavaScript threads, including a high-level abstraction workflow across JavaScript threads, which may become a separate package, and allowing pluggable transport.
  • Debugging tool support.
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author