BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

JavaScript Extension that Adds Parallel Processing Capabilities Unveiled by Intel

| by Dio Synodinos Follow 2 Followers on Sep 16, 2011. Estimated reading time: 2 minutes |

JavaScript, the language that powers the Web, has mainly remained sequentially, although parallel processing capabilities are currently available even on mobile devices. Intel Labs has been working on an extension of JavaScript that takes advantage of multi-core systems and has released a Firefox plugin.

These parallel extensions for JavaScript, code named River Trail, is an Intel Labs project which tries to bring the processing power of Intel’s multi-core CPUs and their vector extensions to web applications. River Trail will try to make possible more compute intensive applications like photo editing, inside the browser.

Integration with existing web technologies was a major consideration, as Stephan Herhut from Intel Labs mentions:

What really excites me about the technology behind River Trail is its seamless integration with existing web technologies. River Trail extends JavaScript with a simple, yet powerful data-parallel programming model. Much effort was spent to make this extension feel as natural as possible. Our goal was to make writing web applications with River Trail as easy as writing regular JavaScript. Furthermore, as River Trail is embedded into JavaScript, it combines well with other upcoming HTML5 APIs. We in particular made sure that River Trail plays nicely with WebGL, a recently introduced JavaScript API to OpenGL used for 3D visualization in the browser: One of our demo applications is a physics simulation with more than 4000 bodies, where the computation is done using River Trail and visualization is performed with WebGL.

River Trail extends JavaScript with deterministic data-parallel constructs that are translated at runtime into a low-level hardware abstraction layer. By leveraging multiple CPU cores and vector instructions, River Trail is claimed to achieve significant speedup over sequential JavaScript.

In particular, it adds the ParallelArray data type to JavaScript. This is a read only data structure holding the actual Parallel Array data that is created by a call to a constructor or is returned from a call to one of the ParallelArray prototype methods. Input to the constructor is typically a JavaScript array, a typed array, or a function that is used to generate the ParallelArray’s values. For example “new ParallelArray([1,2,3])” would create a ParallelArray holding the values 1, 2, and 3.  The result could be a ParallelArray holding the values 1, 2, and 3, which is accessible by functions like combine, filter, map, reduce, etc. which perform work in parallel! JavaScript functions provided to them are compiled to OpenCL. These functions can use a subset of JavaScript.

River Trail is available today as an add-on to the Firefox web browser.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT