Table of Contents
Fetching ...

WebAssembly on Resource-Constrained IoT Devices: Performance, Efficiency, and Portability

Mislav Has, Tao Xiong, Fehmi Ben Abdesslem, Mario Kušek

TL;DR

This study evaluates WebAssembly (WASM) as a portable, sandboxed runtime for resource-constrained IoT devices by comparing wasm3 and WAMR against native C across Raspberry Pi Pico, ESP32 C6, and nRF5340. It analyzes performance, memory footprint, and energy consumption using C and Rust workloads (bubble sort, CRC-16), finding that native code remains fastest and most energy-efficient, while WASM offers portability and security benefits. The results reveal clear trade-offs between lightweight (wasm3) and feature-rich (WAMR) runtimes, and highlight the limitations of interpretation mode, motivating future work on AOT/JIT and RTOS integration. Overall, the findings provide practical guidance for selecting WASM runtimes to achieve cross-platform embedded deployment with acceptable performance and stronger isolation.

Abstract

The increasing heterogeneity of hardware and software in the Internet of Things (IoT) poses a major challenge for the portability, maintainability and deployment of software on devices with limited resources. WebAssembly (WASM), originally designed for the web, is increasingly recognized as a portable, secure and efficient runtime environment that can overcome these challenges. This paper explores the feasibility of using WASM in embedded IoT systems by evaluating its performance, memory footprint and energy consumption on three representative microcontrollers: the Raspberry Pi Pico, the ESP32 C6 and the nRF5340. Two lightweight WASM runtimes, WAMR and wasm3, are compared with the native C execution. The results show that while the native execution remains superior in terms of speed and energy efficiency, WASM offers acceptable trade-offs in return for cross-platform compatibility and sandbox execution. The results highlight that WASM is a viable option for embedded IoT applications when portability and security outweigh strict performance constraints, and that further runtime optimization could extend its practicality in this area.

WebAssembly on Resource-Constrained IoT Devices: Performance, Efficiency, and Portability

TL;DR

This study evaluates WebAssembly (WASM) as a portable, sandboxed runtime for resource-constrained IoT devices by comparing wasm3 and WAMR against native C across Raspberry Pi Pico, ESP32 C6, and nRF5340. It analyzes performance, memory footprint, and energy consumption using C and Rust workloads (bubble sort, CRC-16), finding that native code remains fastest and most energy-efficient, while WASM offers portability and security benefits. The results reveal clear trade-offs between lightweight (wasm3) and feature-rich (WAMR) runtimes, and highlight the limitations of interpretation mode, motivating future work on AOT/JIT and RTOS integration. Overall, the findings provide practical guidance for selecting WASM runtimes to achieve cross-platform embedded deployment with acceptable performance and stronger isolation.

Abstract

The increasing heterogeneity of hardware and software in the Internet of Things (IoT) poses a major challenge for the portability, maintainability and deployment of software on devices with limited resources. WebAssembly (WASM), originally designed for the web, is increasingly recognized as a portable, secure and efficient runtime environment that can overcome these challenges. This paper explores the feasibility of using WASM in embedded IoT systems by evaluating its performance, memory footprint and energy consumption on three representative microcontrollers: the Raspberry Pi Pico, the ESP32 C6 and the nRF5340. Two lightweight WASM runtimes, WAMR and wasm3, are compared with the native C execution. The results show that while the native execution remains superior in terms of speed and energy efficiency, WASM offers acceptable trade-offs in return for cross-platform compatibility and sandbox execution. The results highlight that WASM is a viable option for embedded IoT applications when portability and security outweigh strict performance constraints, and that further runtime optimization could extend its practicality in this area.

Paper Structure

This paper contains 22 sections, 5 figures, 1 table.

Figures (5)

  • Figure 1: Wasm3 execution on Pico.
  • Figure 2: WAMR execution on Pico.
  • Figure 3: Energy consumption of devices with Bubble Sort algorithm.
  • Figure 4: Memory footprint of devices with Bubble Sort algorithm.
  • Figure 5: Execution time of devices with Bubble Sort algorithm.