[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
|
|
Subscribe / Log in / New account

Two paths to a better readdir()

Two paths to a better readdir()

Posted Jul 31, 2014 10:36 UTC (Thu) by niner (subscriber, #26151)
Parent article: Two paths to a better readdir()

Maybe dirreadahead is faster because it allows the kernel to do I/O while the user space program is still processing results, i.e. it's an asynchronous interface.

While dirreadahead certainly has its appeal due to its simplicity and maybe even better performance, but xstat could be useful in other use cases as well. For example we do lots of stat calls to compare mtimes of a source and a preprocessed cache file to detect if we have to re-process the source. In this case we know both file names and just need the mtime.


to post comments

Two paths to a better readdir()

Posted Aug 1, 2014 2:36 UTC (Fri) by adas (guest, #98126) [Link]

Yes, dirreadahead is faster because it does the readahead asynchronously and using multiple workqueues. On the other hand xgetdents is single-threaded and there is a lot of processing involved in collating all the data into the result __user buffer. And yes, the user space program needs to deconstruct the buffer too.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds