Lsr: ls but with io_uring

I applied some of my io_uring learnings to writing an implementation of ls(1) with the goal of minimizing syscalls. The repo is here, and I did a little writeup here. I was mostly interested in the syscall reduction I could get in a realistic program which relies very little on traditional IO (reads, writes, etc). Nearly all the IO for something like ls are syscalls: statx to be specific. I benchmarked syscalls and time of several popular options, syscall results are below.

Program n=10 n=100 n=1,000 n=10,000
lsr -al 20 28 105 848
ls -al 405 675 3,377 30,396
eza -al 319 411 1,320 10,364
lsd -al 508 1,408 10,423 100,512
uutils ls -al 445 986 6,397 10,005

and here’s a bonus screenshot! I added some fancy icons to be like the other big guys (eza and lsd):

24 Likes