categories | tags | Aimee's Blog
Aimee's Study Notes

It is updated automatically after each commit to the org-notes repo. It was last updated on Jul 28, 2021 19:05 UTC.


This page was created/modified in commit 4dd7954 "." on 2021-07-01.
Markdown source of this page

Javascript slow, compared to wasm

categories: hacking

tags: wasm


Description/Summary

WASM vs Javascript

Content

Javascript has dynamic types, which checks each step of types – a lot of conditions. Javascript GC needs time to run. Heap allocated everything. Integers in Rust never touch the heap.

Wasm is approaching as fast as native code. Wasm is basically machine code. 20% instructions to do checks.

Both C++ and Rust do their type checking in compile time but not runtime. C is fast too. But C has weak types and is extremely unsafe.


This site is generated with ox-hugo for Emacs/Org-mode + hugo-bare-min-theme [Aimee's Study Notes]