Repeat a measurement and get variance with perf stat -r 5
Run a command several times and let perf stat print each counter as a mean with its standard deviation, using -r 5 on perf from Linux 6.12.
Short posts that solve one thing: the code, the output we got, and why it works.
Run a command several times and let perf stat print each counter as a mean with its standard deviation, using -r 5 on perf from Linux 6.12.
Add eight floats at once with _mm256_add_ps from AVX in C, loading two vectors with loadu, adding them and storing the result back to memory.
Mark rarely called Rust error handlers with the cold attribute in Rust 1.80, so the optimiser moves them off the hot path.
Turn on -Wpadded in GCC 14 to list every struct that gets padding bytes, then reorder members from largest to smallest to shrink the type.
Time a code section on ESP32 in CPU cycles with esp_cpu_get_cycle_count, then convert to microseconds from the CPU frequency. ESP-IDF v5.4, C99.
A plain atomic load with any memory order compiles to an ordinary mov on x86-64 with GCC 14, so acquire loads are free and only seq_cst stores cost.
Get the L1 data cache line size at run time with sysconf(_SC_LEVEL1_DCACHE_LINESIZE) in glibc 2.41, and handle the 0 it returns when the value is unknown.
We send one email when a new post is published. No spam.