microsoft / devicescript

TypeScript for Tiny IoT Devices (ESP32, RP2040, ...)
https://microsoft.github.io/devicescript/
MIT License
3.27k stars 118 forks source link

Performance of Devicescript #175

Closed louisvangeldrop closed 1 year ago

louisvangeldrop commented 1 year ago

How fast will the compiled code run in comparison to native C/C++ ?

mmoskal commented 1 year ago

Here is a paper we did on a previous project that was compiling TS to native ARM code.

https://www.microsoft.com/en-us/research/uploads/prod/2019/09/static-typescript-draft2.pdf

DeviceScript is using a VM interpreter which is slower (but portable - we currently run on RISC-V, ARM, Xtensa, x86, WASM, and probably much more).

For low level manipulations I would guess anything between 10x-100x.