LINE(8)
π LINE(8) β the line page, but make it cute π
okay bestie, so you opened the line man page from LMBENCH and honestly? it's giving "tiny tool, huge main character energy". let's get into it β¨
πΈ NAME πΈ
line β cache line size π
β¨ SYNOPSIS β¨
line [ -M <len> ] [ -W <warmups> ] [ -N <repetitions> ]
π¦ DESCRIPTION π¦
so line is out here trying to figure out the cache line size in bytes of the largest cache that's smaller than len bytes. that's the whole mission. that's the vibe. π
how does it do it tho? okay so it builds these pointer chains that hit the first word on each cache line on a page β and it meanders randomly through, like, all the lines in a page before it hops over to the next page. very "wandering the mall with no destination" of it ποΈ
then it measures the average memory latency across a whole bunch of line sizes, starting at a line size of one word. and the moment it spots an increase in average latency that's significantly larger than the latency for the smaller line size β boom β it's like "found it" and assumes that's the line size. π₯
and bestie, the reason this works is genuinely so clever, let me explain π§ β¨: for line sizes that are smaller than the true line size, at least two line cache lines fit inside the space of one true cache line. so that cache line gets accessed twice β first access = expensive cache miss π, second access = cache hit π₯³. but once the line cache line is equal to the true cache line size? every single access is a cache miss. no hits. none. periodt. π
π BUGS π
line is an experimental benchmark, no cap. but ngl, it seems to work well on most systems π«Ά
π SEE ALSO π
lmbench(8), tlb(8), cache(8), par_mem(8).
π AUTHOR π
Carl Staelin and Larry McVoy
Comments, suggestions, and bug reports are always welcome. π₯Ίπ (like genuinely, they said it, not me)
k that's the whole page babes, go measure some cache lines, ily ππ
(c)2000 Carl Staelin and Larry McVoy $Date$ β yeah that's the copyright + version tag, right there in the footer where it belongs, slay β
π¦ where this page comes from
- debian bookworm: lmbench 3.0-a9+debian.1-6
- debian trixie: lmbench 3.0-a9+debian.1-9
- ubuntu jammy: lmbench 3.0-a9+debian.1-6
- ubuntu noble: lmbench 3.0-a9+debian.1-6build3
- ubuntu questing: lmbench 3.0-a9+debian.1-9
- ubuntu resolute: lmbench 3.0-a9+debian.1-10
- ubuntu stonking: lmbench 3.0-a9+debian.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms