3 ms·
GPU probably won't be a good fit for the browser, except for purely graphical tasks, like drawing images, for which they are already used for. GPUs are good fo
by GuB-42 3y ago
GPU probably won't be a good fit for the browser, except for purely graphical tasks, like drawing images, for which they are already used for.
GPUs are good for massively parallel tasks, for example, shading every individual pixel on a 3D rendered scene, which is what they are designed for, bruteforcing hash functions, as it is done in cryptocurrency mining, or multiplying large matrices, as it is done in deep learning.
But most of what a browser does is not massively parallel. JS is mostly single-thread, and layout, parsing HTML, or managing network connections may benefit from a bit of parallelism but we are not talking about thousands of simultaneous operations with no interdependence. And for that, GPUs suck, they don't have the caching, branch prediction, synchronization, etc... abilities of a CPU, and attempting to do that on a GPU will only bring it down while its overpowered math units will be idling.
- loa_in_ 3y agoSome things that come to mind: layer compositing, layer transformations, animation (deferred from CPU)
- sebzim4500 3y agoGPUs are already doing all of those things in modern browsers.
- Dylan16807 3y agoThose sound like "purely graphical tasks" to me.