You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Too much useless io in chunk_write due to create_dir_all() #95
ChunkWriterThread::runcurrently 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.
The reason it's called twice is: rust-lang/rust#33707 which I recently fixed with: rust-lang/rust#39799 . It is yet hit stable, That PR also improves the the performance of create_dir_all and makes it "try first and check later".
You're right that it would be better to just try File::create first and mkdir only if it failed. Please submit a PR!
Activity
dpc commentedon Apr 20, 2017
The reason it's called twice is: rust-lang/rust#33707 which I recently fixed with: rust-lang/rust#39799 . It is yet hit
stable, That PR also improves the the performance ofcreate_dir_alland makes it "try first and check later".You're right that it would be better to just try
File::createfirst andmkdironly if it failed. Please submit a PR!dpc commentedon Jul 29, 2017
Done.
rdedup/lib/src/asyncio.rs
Line 408 in ef746ab