This is one more such example of an entire image editing software Adobe Photoshop which is entirely based on our web browsers so you can do all operations all image editing things inside the web browser directly.
Here we compare JavaScript against C and WebAssembly for the blast level routine dexpy. Dexpy multiplies a vector by a scalar and then adds the result to another vector.
In the plot I am showing two different WebAssembly measurements. The first one is WASM and the second one is WASM copy. For the first WebAssembly measurement, I'm measuring WebAssembly performance when performing the computation over vectors which are already allocated in the WebAssembly module heap.
In the second WebAssembly measurement, which is WASM copy, I'm measuring WebAssembly performance when you need to copy data to and from the WebAssembly memory module in addition to performing the blast operation.
So in this plot, as you might have expected, performing computation in WebAssembly without needing to copy performs much better than when needing to copy, especially for routines such as dexpy where copying data adds a significant overhead as compared to the actual operation.
But what may be unexpected is that JavaScript still performs quite well on comparing with WASM copy. That demonstrates that especially for simpler operations using vanilla JavaScript is just fine.
It is only 2 or 2.5 times slower as compared to C. There have been a few more efforts in this direction such as Pyodide for running Python inside your web browsers and WebR for running R inside your web browsers.
Based on these charts we can conclude that standard lib is better or equal to other alternatives based on both loading time and speed.
So let's have a recap of what we have just covered. We first saw how vectorization enables fast and readable numerical code in JavaScript.
Then we saw the role of specialized libraries for ML and stats such as scikit-learn and stats models. Then we also saw how standard lib provides indy arrays, universal functions, core math APIs, and much more.
Also, GLASS and ALIPACK are now accessible inside web browsers using standard lib, and all of this is converging into a real emerging ecosystem with, of course, standard lib at its center.
So how can you get involved in all this? Well, these two QR codes link to the standard lib repository and its blog. So if you just feel to contribute or facing any issue, you can just go ahead and ping the GitHub repository.
You can also read the standard lib blogs which are updated quite regularly regarding the recent activities. Standard lib also participates in Google Summer of Code. It participated last year and this year as well.
That was all from my side. Hope you enjoyed listening to me. Thank you. Have a nice day.
Comments