Which memcpy the Rust libraries are measured with (2026-11-13)

The benchmark firmware is a C firmware: the Rust libraries are linked into it as a static library, and their calls to memcpy go to the C library's (newlib's, optimised for speed). A firmware written in Rust links Rust's own memory functions instead (compiler_builtins, as shipped in the rust-std archive for the target). MEMCPY=rust builds the benchmark that way, for the C code in the firmware too, so the two can be compared. Rust and multi-producer sets, -O2, code in flash, five boards (the Pico 2 was busy).

Mean cycles, C library's memcpy → Rust's:

Board bbqueue, 64-byte block, per byte (write / read) embassy-sync Pipe, 64-byte block, per byte embassy-sync Pipe, 1 byte (write / read) 64-byte copy alone, per byte
nRF5340 DK (M33) 6.3 → 11.5 / 5.5 → 10.3 6.3 → 11.0 / 5.9 → 10.3 221 → 298 / 213 → 294 1.2 → 2.9
NUCLEO-G474RE (M4) 7.5 → 13.7 / 6.2 → 11.4 6.8 → 12.4 / 5.9 → 11.1 190 → 281 / 174 → 264 1.2 → 2.6
NUCLEO-H723ZG (M7) 6.3 → 8.4 / 5.3 → 7.1 4.5 → 6.5 / 4.0 → 5.8 114 → 134 / 105 → 126 0.6 → 1.5
NUCLEO-G0B1RE (M0+) 15.6 → 15.9 / 14.6 → 14.6 13.7 → 14.0 / 13.2 → 13.2 270 → 286 / 251 → 267 2.9 → 3.8
SAM D20 (M0+) 15.8 → 16.7 / 14.8 → 15.4 14.1 → 15.0 / 13.6 → 14.2 290 → 304 / 268 → 280 3.0 → 3.6

("64-byte copy alone" is the benchmark's baseline: one copy of 64 bytes and nothing else.)

What it means for the comparison page: its numbers for bbqueue and embassy-sync Pipe are with the C library's memcpy, the favourable case for them. In a pure Rust firmware built with the stock rust-std they would be slower by the amounts above, unless the project links another memcpy. The page does not show the MEMCPY=rust numbers; whether it should (as a second figure for the Rust libraries) is open.

Records: *-rb-bench-rust-flash-memcpyrust-* and *-rb-bench-mp-flash-memcpyrust-* of 2026-11-13 (commits 9518bf8 and 8e9fcd5; the change between them does not touch the benchmark firmware), compared with the records of the same sets with the default memcpy.