LAT_PROC(8)

πŸ’– LAT_PROC πŸ’–

okay bestie, sit down, hydrate, because we're about to talk about lat_proc β€” a lil tool from the LMBENCH crew that measures how long it takes to make a whole new process. yes. process creation. the origin story of every program you've ever run. it's giving genesis but in microseconds. πŸ¦‹


✨ NAME ✨

lat_proc β€” process creation tests πŸŽ€


✨ SYNOPSIS ✨

lat_proc [ -P <parallelism> ] [ -W <warmups> ] [ -N <repetitions> ]
procedure|fork|exec|shell

so you hit it with some optional flags, then you gotta pick one of procedure, fork, exec, or shell. no, you can't just run it with nothing, she needs a vibe to test. πŸ’…


✨ DESCRIPTION ✨

lat_proc creates processes in three different forms, and each one is more expensive than the last. like, the first one is a lil snack and the third one is a full five-course dinner that also does your taxes. the whole purpose here is to measure the time it takes to create a basic thread of control. that's it. that's the mission. 🫢

here are the forms, listed and described, because we're thorough girlies:

  • Process fork+exit β€” the time it takes to split a process into two (nearly) identical copies and have one of them exit. this is literally how new processes get created, but lowkey it's not very useful for benchmarking real work, because both processes are just doing the exact same thing. it's twins energy. matching outfits, no individuality. πŸ‘―
  • Process fork+execve β€” the time it takes to create a new process and have that new process run a new program. this is the inner loop of all shells (yes, command interpreters, that's the whole job). so every time you type a command and hit enter, you're basically running this test for free. iconic behavior. ✨
  • Process fork+/bin/sh -c β€” the time it takes to create a new process and have that new process run a new program by asking the system shell to find that program and run it. this is how the C library interface called system is implemented. it is the most general and the most expensive of the three. she does the most. she costs the most. no cap. πŸ’€

✨ OUTPUT ✨

output comes at you in microseconds per operation, like so:

Process fork+exit: 6054 microseconds
Process fork+execve: 11212 microseconds
Process fork+/bin/sh -c: 44346 microseconds

see how the numbers just keep climbing?? that's the whole plot twist. fork+exit is the cheap lil starter, and fork+/bin/sh -c is the diva at the end of the runway. πŸ’…βœ¨


✨ ACKNOWLEDGEMENT ✨

funding for the development of this tool was provided by Sun Microsystems Computer Corporation. 🧑 thank you sun, we owe you one fr fr.


✨ SEE ALSO ✨

  • lmbench(8). go read it. it's the mothership. πŸ‘‘

✨ AUTHOR ✨

Carl Staelin and Larry McVoy

comments, suggestions, and bug reports are always welcome. πŸ₯ΊπŸ‘‰πŸ‘ˆ they literally said so. don't be shy, bestie, they want to hear from you.


and that's the whole page!! shoutout to the footer that lives down there: Β©1994 Larry McVoy, with that $Date$ placeholder doing its lil thing, filed under LAT_PROC(8). slay, we're done here, go benchmark something. πŸ’–πŸŒΈπŸ¦‹