I think that this is bullshit! Maybe the author thinks that it is really the case, probably tricked by the language, because using async, but in the end, the syscall to read folders is synchronous...
I think that this is bullshit! Maybe the author thinks that it is really the case, probably tricked by the language, because using async, but in the end, the syscall to read folders is synchronous...
Incidentally, this is why ls without colors or type symbols (-l, -F, --color, and so forth) is a lot faster: it doesn't have to query every file to find out what it is in order to display the color/symbol/permissions/etc. Handy if you're on a slow networked file system and just need to see names.
You may expect so but this is usually not the case. Multiple threads submitting stat or other fs ioctl commands to the disk driver are going to be sequenced and may not be threaded.
This is definitely how it works on Windows. Linux is better, but a lot of disk IO is behind the times. io_uring only has read/write so far.
There's also the page cache involved for reads, so it can be read while actual IO is queued.
ls and similar can (and do) requests the files in batches, so if the directory has enough files for speed to matter you can request one and then asynchronously query whatever additional information you need.
If you only want the filename and whether it's a directory, device or file, then you won't do much better than ls, but you also likely won't do much worse.
But the moment you want e.g. filesize you need to stat() files. That too will be the same whether or not it's ls. But exa also does things like check git and that will add significant overhead that they may or may not alleviate by doing it in parallel.