lsr: ls but with io_uring #1402
rockorager
started this conversation in
Show and tell
Replies: 1 comment
-
|
That's pretty nifty, thanks for sharing! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
Thought I'd share my small attempt at syscall golf: lsr. It's a version of
lsthat uses io_uring to batch as many syscalls as possible - to the point that I am opening / reading / closing/etc/localtime,/etc/passwd, etc using io_uring. The syscall reduction is impressive, and it has some perf gains too over several otherls-replacements. Some benchmarks for time and number of syscalls are summarized below.By far the biggest missing feature of io_uring for this program is
readlink.lsris able to do massive amounts of batching ofstatxbut every encountered symlink requires it's own additionalreadlinksyscall. This doesn't show up in my benchmarks because the test directory is plain files.A couple of
io_uringrelated things to know:IORING_SETUP_CLAMP | IORING_SETUP_SUBMIT_ALL | IORING_SETUP_COOP_TASKRUN | IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUNSQPOLL. That would have some benefit particularly for large directories. There is no reason in particular I'm not using it.Thanks for all the work on io_uring, it's a pleasure to use!
Time
Data gathered with
hyperfineon a directory ofnplain files.Syscalls
Data gathered with
strace -con a directory ofnplain files.Beta Was this translation helpful? Give feedback.
All reactions