Using Client-Side Javascript for Distributed Computing
victorquinn.com
victorquinn.com
The difficulty with this type of application is breaking up the computation into chunks large enough to offset the overhead of getting the data to and from the client to net a "profit" in terms of computation time. As the author mentioned, you have to limit the amount of CPU time that the client uses, otherwise, you'll end up potentially impacting the user negatively. Couple this with the limited amount of time between a user's browser requests and the amount of computational power at your disposal is pretty limited.
Although my implementation was far from optimal (it was purely academic in order to see if the concept would work), I found that in every case, it was on the order of at least 100 times slower than simply doing the computation serially(!) on the server machine. It was actually costing more time to manage the connections between the various clients and the server than the amount of computational work that I was getting from the clients.
Now, it's not to say that something like this couldn't potentially be made to work. But the types of computations that this sort of grid is also severely limited. Due to things like sandboxing and socket restrictions you cannot (easily) have clients collaborate together to perform more complex computations, therefore you are effectively limited to embarrassingly parallel algorithms.
NaCl, maybe. Google isn't helping me figure out if it can do SIMD instructions.
But, you might be a bit surprised by the raw float performance of the latest JS VMs. Running this benchmark, http://stepheneb.github.com/webgl-matrix-benchmarks/matrix_b... on my 3.4Ghz AMD in FF4, CanvasMatrix can multiply 20,000 pairs of 4x4 matrices in 1.5 ms. That's about 1.5 double-precision gigaflops on 1 core. 4 webworkers would give 6 gigaflops. That's low compared to the 50 gigaflops that native, pure-cpu-burn benchmarks get on that processor (when overclocked to 3.6 Ghz) http://www.overclock.net/amd-cpus/499526-official-phenom-ii-... but it's not terrible.
https://github.com/jeresig/testswarm
This seems like it would be an ideal starting point for a project like this.
It would be nice if the browser was a stronger vm specifically suited for executing untrusted objects, yet still with a more traditional os api, filesystem access, and real network interface. But the web still sucks for now.
"You've heard of SETI@home? We're SETI@Chrome." http://2010.nodeknockout.com/teams/anansi http://news.ycombinator.com/item?id=1645520