Mehdi Akiki

Posts tagged "performance"

  • Published on

    Investigation · Part 16 of 20 · What survives a crash

    Group Commit: How Databases Make fsync Cheaper

    With every writer syncing alone, my laptop made about 1,800 records per second durable, with 1 or 16 writers. With group commit, one fdatasync for all waiting records, 16 writers reached 15,822. A small delay before the sync helped 16 writers and hurt one, as PostgreSQL documents.
  • Published on

    Investigation · Part 16 of 20 · When the benchmark lies

    When the Working Set No Longer Fits in Cache

    One step of i = a[i] costs 1.4 ns when the array fits in L1 and 114 ns when it is 128 MiB, the same instruction. I measured the steps on a P-core and an E-core, a sequential read of the same arrays, and why I could not show the effect of huge pages.
  • Published on

    Investigation · Part 15 of 20 · When the benchmark lies

    Does Code Alignment Change the Speed of the Same Code?

    I placed the same 11-instruction loop at all 64 positions of a cache line, two copies each, and measured them in shuffled order. At one position the loop was 16 to 21 percent slower, in three runs out of three. The same bytes, a different address, a different speed.
  • Published on

    Investigation · Part 14 of 20 · What survives a crash

    SQLite WAL Mode: Fewer fsyncs, a Different Promise

    In WAL mode, a SQLite commit with synchronous=FULL is one frame and one fdatasync, and with NORMAL it is no sync at all. I followed both with strace on my laptop, measured them, and quote what the documentation promises after an application crash and after a power loss.
  • Published on

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

    What fork Really Copies: Copy-on-Write Measured

    fork of a process with 2 GiB of touched memory took 16 ms here, because it copies page tables and not memory. I measured the copies that come later when the child writes, what reading costs, what happens to huge pages, and why posix_spawn stays under a millisecond.