Skip to content

Too much useless io in chunk_write due to create_dir_all() #95

Closed
@lukaslueg

Description

@lukaslueg

ChunkWriterThread::run currently calls create_dir_all() twice, which is useless at best but causes quite a lot of IO.

We can reduce IO further by asking for forgivness instead of permission and moving the create_dir_all()-call into a new error-path for fs::File::create(&tmp_path).unwrap();. As the path will exist for almost all but one calls to fs::File::create() per path, we should just try to create the file directly and only create the path structure in case we fail. This saves us from a lot of stat64-calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions