Repository navigation
Lua Host Benchmark
This compares equivalent fib(30), 10-million-iteration integer loop and one-million-object
workloads. It is a host comparison, not a microcontroller measurement. Lua uses tables
and metatables for objects; MicroCS uses List<P>; nanoFramework uses ArrayList.
All programs print the same checksums (832040, 29999994, 980302).
Reproduce on Linux x86-64 with GCC, Python, .NET 8 and a Lua 5.4.8 source build:
make -j2 mcs
make bench # builds build/bench_host
sh bench/compare/nanoframework/run.sh # downloads and builds nanoCLR benchmark
export LUA_DIR=/path/to/lua-5.4.8 # build with: make generic MYCFLAGS=-O2
mkdir -p build/compare-lua
cc -O2 -I"$LUA_DIR/src" bench/compare/lua/lua_runner.c "$LUA_DIR/src/liblua.a" -lm -ldl -o build/compare-lua/lua_runner
for name in fib loop objects; do "$LUA_DIR/src/luac" -o "build/compare-lua/$name.luac" "bench/compare/lua/$name.lua"; done
python3 bench/compare/lua/run_compare.pyThe script pins to one available CPU, rotates runtime order over three rounds,
and prints medians of each round's three runs, then medians across rounds. It
checks Lua and nanoFramework checksums and stores per-round medians in
build/compare-lua/results.json. MicroCS uses bench_host's image timings
(startup subtracted); Lua times bytecode load, execution and print after state
creation and library setup; nanoFramework times execution and print inside its
program, without process startup or assembly load. Hence timing boundaries
and object representations differ; do not interpret the values as perfectly
identical runtime operations or board performance. MicroCS image output can be
checked separately with ./mcs -c bench/fib.cs -o /tmp/fib.mcsb && ./mcs /tmp/fib.mcsb.
Generated from the MicroCS repository (source branch · revision 37bd1f1). Edit the source files, not the wiki.
Start here
Step-by-step guides
- Guides
- Guide PC Simulator
- Guide ESP32
- Guide ESP32 C3 OLED
- Guide Raspberry Pi Pico
- Guide STM32
- Guide Arduino
- Guide Zephyr
- Guide Peripheral Settings
- Guide DMA
Hardware
- Hardware API
- Power Management
- Bluetooth LE
- CAN Bus
- Rotary Encoders
- Peripheral Configuration
- DMA
- Device Drivers
- Wi Fi and Networking
- U8g2 Displays
- LVGL Graphics
- Filesystem
- Threads
- Scheduler
Ports
- Porting and Build Systems
- Port ESP32
- Port RP2040 RP2350
- Port STM32
- Port STM32 Firmware
- Port Zephyr
- Port NuttX
- Port Arduino
C# and the runtime
- Language
- Standard Library
- JSON
- Standalone Firmware
- MicroCS Studio
- Web Flasher
- Studio Template Authoring
- Examples
- LVGL Examples
Embedding and tuning
- Embedding
- Configuration
- Small MCUs
- Memory Budgets
- Low RAM Firmware Example
- Performance
- Runtime Benchmark Comparison
- Lua Host Benchmark
Internals
Project