7 ms·
Interesting that there is a 1000x speed difference (0.1 vs 100 ms, in Chrome) between the shader and the JS/WebASM versions even with just Intel integrated grap
by zurn 9y ago
Interesting that there is a 1000x speed difference (0.1 vs 100 ms, in Chrome) between the shader and the JS/WebASM versions even with just Intel integrated graphics.
- Klathmon 9y agoEven after working with them for a while, GPUs still feel like cheating. They are just so goddamn good at what they do. That kind of speed up isn't just a fluke here, it's pretty normal when your work aligns with what a GPU does best.
- pjmlp 9y agoIt is a complete different way of working, but sometimes it just feels like going back to Amiga coding with Blitter and DMA.
- gmueckl 9y agoI've been working with GPUs for many years now and I still get surprised by their performance: some things turn out to be so bloody fast that I initially think that i must do something wrong. Other times, CPU implementations run circles around the GPU for no obvious reason. It's not intuitive and I still have a hard time wrapping my head around how fast these things are when they are at their best.
- roywiggins 9y agoThey're really fast even if you're sort of abusing them. Using fragment shaders to render entire scenes ("two triangle" style) probably wasn't what GPUs were built to do but the technique is awfully effective. I mean: https://www.shadertoy.com/view/Mt2yzK https://www.shadertoy.com/view/Mt2yzK
- andybak 9y agoIt was would interesting to compare a C or Assembly version against a shader version. My hunch is that this is just a use case where a general purpose CPU is left in the dust by a modern GPU.
- singularity2001 9y agothe emscripten.cpp is pretty much c?
- singularity2001 9y agooh you mean outside of the browser. yes that would be interesting
- andybak 9y agoYep. That's what I meant.
- simooooo 9y agoA shader is just taking advantage of the GPU parallelism. Would still wreck C++ implementation.
- modeless 9y agoThe GPU version is much faster, but I doubt it's that much. I suspect the actual rendering time is not being measured because it happens asynchronously. Still though, the potential for using GPUs to accelerate computations is high and I think too often overlooked by web developers, even those doing image processing.