Thomas Ross Hallock

A proof of concept HTML + JS-based distributed computing platform

[update] Just fixed a bug that was preventing this from working in most browsers. Go ahead and give it a try now.
distributed browser based Mandelbrot set rendererI made this browser-based Mandelbrot set zoomer for Yahoo’s Open Hack Day NYC 2009. It is built in HTML + JS and will use the browser of anyone that has the page loaded to construct fractal images for other users that are also viewing the page. Click on the large image to zoom deeper and deeper. It works best in Safari 4, okay in Firefox 3.

This is a proof of concept of portable browser-based distributed computing. (It even runs on iPhone.) The web server will ask your browser to render a specific square on the complex plane onto a canvas. Your browser will then submit the rendered square by turning the canvas into a data URL and posting it to the server’s cache. At the same time, your browser is requesting that the server send out render requests for all squares necessary to make up your current view of the complex plane. These requests may be rendered by your browser, or they may be rendered by another user’s browser that currently has the page running. Load it up on two or three computers at the same time and you’ll notice a significant increase when rendering parts of the fractal. The server caches the tiles, so browse to an obscure part of the fractal to make sure that the system is actually sending requests to the swarm. You can see the last square that your browser rendered just below the large square.

This technique can be used for a specific type of problem where the information that describes the problem and the result is significantly lighter-weight than the computation required to solve it. Specifically, this would also work well for a web-based ray-tracer.

This idea was partially inspired by Resig’s Test Swarm service that distributes front-end toolkit testing to any user that hits the site with their browser.

3 thoughts on “A proof of concept HTML + JS-based distributed computing platform

  1. Matt Kaufman

    Hi Thomas,

    I remember you showing me this — with the 2 fractals in the 2 different windows next to each other! I think I didn’t get the point at that time ( probably tired ), but cool! I would love to meet you again. :)

Leave a Reply

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