For a live demo, please see: https://sniklaus.com/wasmray
For a discussion, see Reddit: https://www.reddit.com/r/programming/comments/7k4v5t/
Unsurprisingly, the version using GLSL / Shader is significantly faster than the others, showing that it is always important to use the right technology for the right purpose. However, this was not the point of this experiment. Instead, it shows how WebAssembly can potentially be used for an improved performance. To accelerate WebAssembly further, threads could be leveraged. Of course, one could make the argument that a different task could have shown the performance advantages of WebAssembly better. However, I also simply wanted to implement a raytracer.
|Firefox 57||~407.3 ms||~112.3 ms||~87.4 ms||~1.9 ms|
|Firefox 58||~358.9 ms||~103.2 ms||~82.7 ms||~1.9 ms|
|Chrome 62||~191.7 ms||~167.2 ms||~115.7 ms||~2.1 ms|
|Chrome 63||~181.4 ms||~154.2 ms||~120.7 ms||~2.2 ms|
Please refer to the appropriate file within this repository.