Skip to toolbar

Community & Business Groups

Making typed array processing really fast

Hello all,

We all know that the computational performance of the code generated by modern ECMAScript JIT/AOT engines is very high, and for most purposes “good enough”. In fact, I have encountered several situations where my JavaScript code runs as fast as (or even faster than) the corresponding optimized compiled C++ code (g++ -O3).

Still, there are situations when this is not enough. For instance, in real time audio processing you want to minimize latencies and CPU load as far as possible.

One way to increase the performance and reduce latencies is to utilize the instruction level parallelism that is available in modern CPU architectures through SIMD instructions. On the other hand, it is very difficult to make use of these instructions in a platform agnostic language such as ECMAScript (see [1] and [2], for instance).

The River Trail proposal from Intel solves the parallelism issue by introducing the new data type ParallelArray, upon which fairly generic ECMAScript operations can operate. While this is a nice and quite generic solution, it adds some fairly heavy requirements on the ECMAScript compiler.

I decided to make an attempt at creating a partial solution that is easy to integrate into current Web clients, yet powerful enough to solve many problems (especially related to signal processing).

At this point, there is an unofficial draft specification, and a JavaScript polyfill and demos. You can also find an open source C++ implementation of most of the required functionality.

For continuing this work, I’ve proposed the community group Web Array Math. If you are interested in participating, feel free to support it.

Regards,

Marcus Geelnard, Opera Software ASA

[1] http://blog.aventine.se/post/16318162396/simd

[2] https://bugzilla.mozilla.org/show_bug.cgi?id=644389

Leave a Reply

Your email address will not be published. Required fields are marked *

Before you comment here, note that this forum is moderated and your IP address is sent to Akismet, the plugin we use to mitigate spam comments.

*