Mehdi Akiki

Posts tagged "performance"

  • Published on

    Investigation · Part 2 of 3 · Async Rust under the hood

    Async fn in a dyn Trait: What the Box Costs, Measured

    Calling an async method through dyn Trait needs a boxed future. I measured what that box costs per call, with an allocation counter and a million calls, and where it actually matters.
  • 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 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.
  • Published on

    Investigation · Part 5 of 10 · Inside a database index

    A Covering Index Never Touches the Table

    When an index has every column a query needs, SQLite never opens the table. For one row this saves almost nothing. For 67,245 rows it was 98 ms against 21 ms with a warm cache, and 875 ms against 24 ms with a cold one.
  • Published on

    Investigation · Part 3 of 10 · Following a TCP connection

    Why a Small Write Can Wait 40 Milliseconds: Nagle and Delayed ACK

    My client wrote each request in two small pieces, and almost every request took 43 ms or more on loopback, where a round trip costs microseconds. I followed it with strace, ss and the kernel counters to see how Nagle's algorithm and delayed ACK wait for each other.