BW_MMAP_RD(8)

๐Ÿ’… bw_mmap_rd โ€” from the LMBENCH collection, section 8 (admin/system commands, bestie, we're in the big leagues)

okay so picture this: it's giving "read a whole file and add up all the numbers" but make it a benchmark. that's the whole vibe. let's get into it โœจ


โœจ NAME โœจ

bw_mmap_rd โ€” clock how long it takes to read a file and sum it all up ๐Ÿงฎ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

bw_mmap_rd [ -P <parallelism> ] [ -W <warmups> ] [ -N <repetitions> ]
size file

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so bw_mmap_rd makes a memory mapping to the file, and then reads through that mapping in an unrolled loop โ€” literally the same kind of loop they use over in bw_mem_rd(8). slay, consistency.

and the important part, bestie: this benchmark is meant to be used on a file that's already in memory. like, the file is sitting in RAM. so what you're measuring is a reread benchmark โ€” a re-read, not a first-touch-from-disk moment. if you wanna do other kinds of file benchmarking, go hang out with lmdd(8) instead, she handles that ๐Ÿ’–

also the size spec? you can end it with k or m, and they mean kilobytes (* 1024) or megabytes (* 1024 * 1024). cute, right? no cap.


๐Ÿ”ฅ OUTPUT ๐Ÿ”ฅ

the output format is exactly "%0.2f %.2f\n", and the two numbers are megabytes and megabytes_per_second. so like:

8.00 25.33

first number = the megabytes, second number = megabytes per second. iconic. periodt.


๐Ÿ‘‘ MEMORY UTILIZATION ๐Ÿ‘‘

this benchmark should move approximately the reported amount of memory. that's the whole point, she's moving memory and she's telling you how much ๐Ÿซถ


๐ŸŒˆ ACKNOWLEDGEMENT ๐ŸŒˆ

funding for the development of this tool was provided by Sun Microsystems Computer Corporation. we love a sponsor that funds the vibes ๐Ÿ’œ


โญ SEE ALSO โญ


๐ŸŽ€ AUTHOR ๐ŸŽ€

Carl Staelin and Larry McVoy โ€” absolute legends, no notes ๐Ÿ’…

and fr fr: comments, suggestions, and bug reports are always welcome. they literally want to hear from you, bestie, don't be shy ๐Ÿ˜ญ


copyright (c) 1994 Larry McVoy, and this page's date stamp is the good old $Date$ โ€” yes, she's a classic, she's been iconic since '94, and she's still serving BW_MMAP_RD(8) energy at the very bottom of the page. bye bestie, go measure some rereads ๐Ÿฆ‹๐Ÿ’–โœจ