Mehdi Akiki

Writing archive

Everything published under Writing, newest first. Each entry is labelled as part of an investigation, an article or reference. Short engineering notes have their own archive.

  • Published on

    Article · Through the layers

    Why Rust Async Futures Get So Large

    Rust async functions store every value needed after an await. Learn to measure future size, identify saved fields, and reduce it without boxing everything.
  • Published on

    Investigation · Part 3 of 20 · From source to a running process

    Where Your Variables Live in a Binary: .text, .rodata, .data and .bss

    I printed the address of every kind of variable in a C program and a Rust program and matched them with nm and readelf. A 16 MiB array of zeros costs nothing in the file, the same array with one byte set to 1 costs 16 MiB, and a Rust const has no address at all.
  • Published on

    Investigation · Part 3 of 20 · What survives a crash

    How to Save a File Without Losing It: Write, fsync, Rename

    I killed a program 300 times while it saved a file. Writing in place left a cut file 233 times, without any power loss. A temp file, fsync and rename never did. Then I traced how sed, Python, cp, install and git save files.
  • Published on

    Investigation · Part 2 of 20 · What survives a crash

    What fsync Costs on a Laptop SSD

    I measured 1,000 rounds of a 4 KiB write followed by a sync on my laptop: about 540 microseconds for an append, 208 for an overwrite in place, a slowest round eleven times the median, and 3.6 microseconds on tmpfs, where fsync waits for nothing.