The easy way to supercharge
your number-crunching.

App Images

GPGPU made simple.

Offload complex parallel calculations to the GPU and get JS-accessible results
with a single call. Crunch tens of millions of numbers at once.

// Test if turbo.js is available
if (turbojs) {
// Allocate a float-array of size 1,000,000
var blah = turbojs.alloc(1e6);
// Initialize data
for (i = 0; i <= 1e6; i++) blah.data[i] = i;
// [0, 1, 2, 3, 4]
console.log(blah.data.subarray(0, 5));
// A simple kernel that calculates input *= 4
// for all 1e6 floats in parallel
turbojs.run(blah, `void main(void) {
commit(read() * 4.);
}`);
// [0, 4, 8, 12, 16]
console.log(blah.data.subarray(0, 5));
// That's it :-)
}

Non-volatile

Data is always accessible from the GPU and JavaScript side. Typed arrays ensure data integrity and low transfer overhead. Each run debugs the kernel code on the fly.

Dynamic Data Layout

Work on a flat float array (example to the left) or use 4D vectors, utilizing four 32bit floats I/O per parallel operation. turbo.js takes care of data transformation for you.

In fact, you're using it right now.

Here's how


When you loaded this page, we ran a small benchmark to give you an idea about the performance increase you can expect with your current system, running a parallel workload with turbo.js. While the JS and the turbo.js code looks almost identical, you can see the benefit in the measurement below.

The Benchmark


The benchmark generates a set of 250,000 (array size is 1,000,000) random points on a 2D plane and thus uses 4D vectors. The first two components of each vector are random inputs for a mandelbrot function with an iteration depth of 1,000. The result (a greyscale color value) is written to the third component as the output.

Highly modular


Ever written in a C-like language? Then you'll pickup GLSL in no time. This is the language that turbo.js kernels are written in. Use string processing to access other JS variables or generate kernels JIT, the verbose GLSL debugger is there to help you.

Pure JavaScript

JavaScript & turbo.js

The numbers, Mason!

Performance is measured in vectors per milliseconds. The gauges display the number of vectors in thousands. So a result of 1.23 would indicate a speed of 1,230 vectors (4,920 floats) per ms. In this specific case, V/ms is equivalent to points/ms on the fractal surface.

Designed for Desktop and mobile.

On low power CPUs with integrated graphics, or even older phones, the performance gain from using turbo.js is going to be the the most obvious. However, all client-side parallel calculations can benefit from GPGPU - everything from image processing to geo-analytics. Technically, datasets for turbo.js could scale to multiple arrays, each with hundres of millions of values, but you're going to hit browser memory limits before ever exhausting the capabilities of your GPU.

Regrettably, some phone manufacturers choose to use older GPU models for their devices that don't support the required texture format turbo.js needs. That's why, e.g., turbo.js works on Samsung S7 models using the Qualcomm Adreno 530, but not ones with the ARM Mali-T880 MP12.

Scroll to Top