BW_PIPE(8)

πŸ’– bw_pipe β€” bestie we're timing data through pipes πŸ’–

okay so this is bw_pipe from the LMBENCH manual, section 8, and it's genuinely one of the cutest little benchmarks ever. let's get into it 🫢


✨ NAME ✨

bw_pipe β€” time data movement through pipes 🌸


✨ SYNOPSIS ✨

bw_pipe [ -m <message size> ] [ -M <total bytes> ] [ -P <parallelism> ]
[ -W <warmups> ] [ -N <repetitions> ]

like, look at her. five whole options. she's serving ✨


✨ DESCRIPTION ✨

so what she does is: bw_pipe makes a Unix pipe between two processes and moves total bytes through that pipe in message size chunks. and bestie, hear me on this β€” pipes are typically sized smaller than that, so don't come for me when the chunks don't fit, that's literally just how pipes are πŸ’…

the default total bytes is 10MB and the default message size is 64KB. iconic defaults, no notes.


✨ OUTPUT ✨

the output format is literally this, character for character:

"Pipe bandwidth: %0.2f MB/sec\n", megabytes_per_second

which in real life looks like:

Pipe bandwidth: 4.87 MB/sec

okay but that number? that's the whole point. that's the tea πŸ“


✨ MEMORY UTILIZATION ✨

this is the part where it gets lowkey unhinged. this benchmark can move up to six times the requested memory per process. SIX. 😭

there are two processes, babes: the sender and the receiver.

most Unix systems implement the read/write system calls as a bcopy from/to kernel space to/from user space. and bcopy will use 2-3 times as much memory bandwidth: there's one read from the source and a write to the destination. the write usually results in a cache line read and then a write back of the cache line at some later point. so yeah, she's eating memory for breakfast πŸ’€

the good news? memory utilization might be reduced by 1/3 if the processor architecture implemented "load cache line" and "store cache line" instructions (as well as getcachelinesize). so like... theoretically slay, if your CPU was built different 🧚


✨ ACKNOWLEDGEMENT ✨

funding for the development of this tool was provided by Sun Microsystems Computer Corporation. we love a sponsor, periodt πŸ‘‘


✨ SEE ALSO ✨

go read that one too, iykyk πŸ’œ


✨ AUTHOR ✨

Carl Staelin and Larry McVoy wrote this and honestly? kings πŸ‘‘

Comments, suggestions, and bug reports are always welcome. fr fr, they want your feedback, don't be shy 🌈


and that's the whole page bestie!! this is (c)1994 Larry McVoy, the date on this version is $Date$, and the source is the LMBENCH manual, section 8. mwah πŸ’‹ βœ¨πŸ’–πŸŽ€πŸ¦‹πŸŒΈ