In this video I show the process of setting up AssemblysScript to WebAssembly compilation and how to test and evaluate the performance of placing computation in WASM compared to just using Javascript. AssemblyScript has the goal to provide TypeScript like syntax as much as possible and is therefore suitable for those that prefer to write Javascript and TS over alternatives like C, C++, Python, Go, Rust, Java, PHP, and so on. The functions covered in the video is a simple Add function, Factorials and Squaring all elements in an array. I also try to investigate the impact of passing large parameter payloads between JS and WASM and the glue code needed when passing more complex datatypes as parameters. Enjoy! :D

Full Code: https://github.com/danba340/assemblyscript-benchmarks

Setup from scratch steps:
npm init -y
npm install --save @assemblyscript/loader
npm install --save-dev assemblyscript
npx asinit .
npm run asbuild

Twitter: https://twitter.com/BarelyDaniel
Github: https://github.com/danba340

#wasm #webassembly #assemblyscript #typescript #javascript

WebAssembly - Tutorial and Performance testing - [AssemblyScript to WASM]
8.10 GEEK