Skip to content

Excessive stat syscalls on linux #79

Closed
@the8472

Description

@the8472

The directory traversal performs a .metadata() on each entry to check whether it is a directory, which results in a syscall. This is extremely wasteful since DirEntry::file_type can grab the file type directly from the readdir results which are obtained in batches via getdents syscall, i.e. only 1 syscall every N directory entries.

An additional problem is that there are multiple metadata() calls. They are not cached on the file descriptor, so each call results in an additional syscall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions