XDVDFSFilesystem is inefficient in how it accesses the underlying filesystem structure, particularly when reading directory contents. Some of these are due to constraints in the xdvdfs-core read library functionality that needs improvement.
All of the filesystem trait methods require path walking from the root to the source that the function is being called on. Each path walk does a tree traversal on the dirent table for each component of the path (except the last).
The read_dir function performs a tree walk to list the full contents of the directory. This can be replaced with array iteration on the read library layer. Performing tree walks is not efficient in performing reads, and this is masked by filesystem-level caching in the underlying block device.
The required improvements are:
Cache useful results of any read operation on a path in memory. This can mostly eliminate walking the tree on each filesystem trait call, as this information is retrieved by read_dir when the entries are first discovered.
Implement array-style directory scanning in the read library, and then use that in read_dir to avoid doing tree walks. The array scan should read large sections of the dirent table into memory to improve performance on non-cached block device reads (e.g. in xdvdfs-web).
XDVDFSFilesystem is inefficient in how it accesses the underlying filesystem structure, particularly when reading directory contents. Some of these are due to constraints in the xdvdfs-core read library functionality that needs improvement.
read_dir
function performs a tree walk to list the full contents of the directory. This can be replaced with array iteration on the read library layer. Performing tree walks is not efficient in performing reads, and this is masked by filesystem-level caching in the underlying block device.The required improvements are:
read_dir
when the entries are first discovered.read_dir
to avoid doing tree walks. The array scan should read large sections of the dirent table into memory to improve performance on non-cached block device reads (e.g. in xdvdfs-web).