3 ms·
Is there any data on the performance cost of JS/WASM context switches? The way the architecture is described, it sounds as if the costs could be substantial, bu
by xg15 1y ago
Is there any data on the performance cost of JS/WASM context switches? The way the architecture is described, it sounds as if the costs could be substantial, but the approaches described in the article basically hand them out like candy.
This would sort of defeat the point that WASM is supposed to be for the "performance critical" parts of the application only. It doesn't seem very useful if your business logic runs fast, but requires so many switching steps that all performance benefits are undone again.
- breve 1y agoHere are a couple of talks on Leptos (https://www.leptos.dev/ https://www.leptos.dev/), how it works and performs: https://www.youtube.com/watch?v=4KtotxNAwME https://www.youtube.com/watch?v=4KtotxNAwME https://www.youtube.com/watch?v=V1cqQRmVAK0 https://www.youtube.com/watch?v=V1cqQRmVAK0
- giancarlostoro 1y agoNot entirely sure, but C#'s Blazor is amazing. I can stick to purely C# code, front-end and back-end, we rarely call out to JS unless its for like file uploading dialogs. I don't want to ever touch JavaScript again after this workflow. Edit: And if you don't want to do "WebAssembly" you can have it do it all server rendered, think of a SPA on steroids.
- markdog12 1y agoYeah, it's very unfortunate for WebGL/WebGPU apps, where every call has to pass/convert typed arrays and issue a js gl call. It pretty much kills any advantage of using WASM. Hope that changes.
- breve 1y agoWebAssembly is the faster option for WebGL applications on the web, not least because you also might want to run things like physics engines: https://playgama.com/blog/general/boost-html5-game-performance-with-webassembly/#assessing-current-performance-bottlenecks-in-html5-games https://playgama.com/blog/general/boost-html5-game-performan...
- sitkack 1y agoHow can you reconcile this with all of the AAA games that have been shown to work well on Wasm+WebGL ? What is different between your usage and theirs?
- Jyaif 1y agoWhich AAA games run well on Wasm+WebGL?
- snapcaster 1y agoA quick search shows that there aren't any AAA games that support those platforms. What are you referring to?
- afiori 1y agoAccording to a benchmark from 2018 it might not be expensive to go between js and wasm https://hacks.mozilla.org/2018/10/calls-between-javascript-and-webassembly-are-finally-fast-%f0%9f%8e%89/ https://hacks.mozilla.org/2018/10/calls-between-javascript-a... It is still the same jit calling itself, there is no reason it should be far slower than js-to-js
- fidotron 1y agoThis problem is how you spot people that have tried to do it vs those that just talk about it. Everyone ends up with batching calls back and forth because the cost is so high. Separately the conceptual mismatch when the js has to allocate/deallocate things on the wasm side is also tedious to deal with.