I am new to rust. In past few days I learnt a lot from this community. With your help, I have made a code which reads 5000 files, do some transformation and write 700 files. However, I am still having issues with performance and I am trying to optimise. I could see that Writing to file was taking some time, so wanted to get an opinion on how to optimise it
//file_holder is hashmap
//file is a custom struct with 3 hashmap<String, f32>
file_holder.par_iter().for_each(|(name,file)| {
serde_json::to_writer(&fs::File::create(name.to_string() +".json").expect("Failed writing"), &file).expect("Failed writing");
});