NuttX

Here are the details on NuttX thread metric benchmark results as presented here, how tests are implemented and what configuration was used to run these tests. Benchmark results history is also provided on this page. Currently NuttX is only benchmarked in single configuration with kernel / usermode separation turned off.

Benchmark Test IPC cost

First chart shows comparison of NuttX to other RTOSes in terms of “instructions per benchmark iteration”. The data is derived from NuttX benchmark score and known CPU frequency. Actual numbers are summarized in the table below. This metric estimates instruction count needed to perform one benchmark iteration involving all the typical overhead of the running system. In fact, this metric shows CPU cycles consumed to perform one benchmark iteration rather than instructions. Yet the term “IPC” is used for this purpose and understood in the industry, so we will stick to this use as well. Lower IPC means that one iteration can finish earlier and system can achieve higher performance.

Test Name NuttX 13.1.0
Calibration 12.03
Message Passing 1531.4
Synchronization 191.79
Cooperative Scheduling 601.48
Preemptive Scheduling 1127.99

NuttX build configuration

We configured our NuttX build to resemble configuration of other systems as closely as possible. Therefore, our NuttX build had debug disabled. The relevant portion of defconfig is below:

CONFIG_ARCH_CHIP="stm32l4"
CONFIG_ARCH_CHIP_STM32=y
CONFIG_ARCH_CHIP_STM32L432KB=y
CONFIG_ARCH_CHIP_STM32L4=y
CONFIG_BASE_DEFCONFIG="stm32l476-mdk/nsh"
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_STACKDUMP=y
CONFIG_BUILTIN=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEBUG_SYMBOLS_LEVEL="-ggdb3"
CONFIG_RR_INTERVAL=0
CONFIG_USEC_PER_TICK=1000

We let NuttX decide its optimization flags and enabled full optimization. As with other builds, we generated debug symbols to actually retrieve test results. Timer tick was set to 1ms as with other RTOS kernels.

Mutex priority inversion handling wasn’t enabled in kernel which provided NuttX with slight performance advantage over other kernels which don’t have switch that can turn it off.

NuttX vs. CMRX

Following chart is a comparison of NuttX and CMRX performance in thread metric benchmark. The chart displays same data as main benchmark chart, with only NuttX and CMRX present. Whichever of two systems gained higher score is selected as reference for given benchmark test, the score of latter system is displayed as fraction of other’s system. So for example a score of 82% would mean that slower system got 82% of score of faster of two RTOSes.

Performance History

Below is chart displaying performance history of NuttX releases in thread metric benchmark. Chart displays scores achieved in each of benchmarks (except basic processing benchmark) for each tested NuttX release. Version history goes all the way back to NuttX 13.0.0. Older NuttX versions didn’t support CMake-based buildsystem and thus our benchmark couldn’t be built on them.

Benchmark Summaries

1. Basic Processing

Purpose: Measures raw processing throughput without kernel overhead.

Method: A single thread continuously increments a counter in a tight loop.

What It Measures: Maximum achievable loop iterations, establishing a baseline for comparing kernel overhead in other benchmarks.


2. Cooperative Scheduling

Purpose: Measures voluntary context switch efficiency.

Method: Five threads at equal priority take turns executing. Each thread increments its counter and yields control.

Kernel Primitives Used:

What It Measures: Cost of voluntary context switches when threads explicitly yield CPU to peers of equal priority.


3. Preemptive Scheduling

Purpose: Measures priority-based preemptive context switch efficiency.

Method: Five threads with different priorities form a chain. Thread 0 (lowest priority) resumes thread with priority 1. This chain continues up until thread 4 which only suspends itself. Each of threads 1 - 4 (except of thread with lowest priority) suspends itself once thread with higher priority is resumed.

Kernel Primitives Used:

What It Measures: Cost of involuntary (preemptive) context switches driven by priority differences and thread suspending / resuming.


4. Message Processing

Purpose: Measures message queue operation overhead.

Method: A single thread sends a message to a queue and immediately receives it back, measuring round-trip message passing cost.

Kernel Primitives Used:

What It Measures: Combined cost of enqueueing and dequeueing messages (16-byte messages, queue depth 16).


5. Synchronization

Purpose: Measures mutex operation overhead.

Method: A single thread repeatedly acquires and releases a mutex, measuring lock/unlock cycle cost.

Kernel Primitives Used:

What It Measures: Cost of uncontended mutex acquisition and release (no actual contention since single thread).

← Zephyr FreeRTOS →