backhand
backhand copied to clipboard
FilesystemWriter::write on multiple threads
Hello,
I'm evaluation backhand as a replacement for calling external squashfs tools. There's a significant drop in performance when creating a fs due to the lack of parallelism. My application spends most of its time somewhere in a compression implementation which is executed within a single thread.
Is there currently any change to utilise more threads for the compression?
Thanks
@flxo
You are right, we currently don't have any methods that spawn multiple threads for writing a new filesystem. You would just need a new lock on the writer in this method, with a rayon::par_iter or something in this spot: https://github.com/wcampbell0x2a/backhand/blob/9fdf0cf8192155b04da9c3b5e34ba6c8047d8e16/src/filesystem/writer.rs#L440.
Thanks for the update. Probably this needs some refactoring because the compression happens in data_writer.add_bytes(...) and files is borrowed from self.
Thanks for the update. Probably this needs some refactoring because the compression happens in
data_writer.add_bytes(...)andfilesis borrowed from self.
Feel free to submit a MR, I'm quite busy at the moment to do this!