mirror of
https://github.com/numtide/treefmt.git
synced 2024-09-11 17:07:44 +03:00
engine: format in parallel
Re-introduce the magic by @basile-henri before: 1.374864208s after: 637.515185ms
This commit is contained in:
parent
538fd56c57
commit
9fcdd5619f
@ -3,6 +3,7 @@
|
||||
use crate::{config, eval_cache::CacheManifest, formatter::FormatterName, CLOG};
|
||||
use crate::{expand_path, formatter::Formatter, get_meta_mtime, get_path_mtime, Mtime};
|
||||
use ignore::WalkBuilder;
|
||||
use rayon::prelude::*;
|
||||
use std::iter::Iterator;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{collections::BTreeMap, time::Instant};
|
||||
@ -154,7 +155,7 @@ pub fn run_treefmt(
|
||||
// Now run all the formatters and collect the formatted paths.
|
||||
// TODO: do this in parallel
|
||||
let new_matches = matches
|
||||
.iter()
|
||||
.par_iter()
|
||||
.map(|(formatter_name, path_mtime)| {
|
||||
let paths: Vec<PathBuf> = path_mtime.keys().cloned().collect();
|
||||
// unwrap: the key exists since matches was built from that previous collection
|
||||
|
Loading…
Reference in New Issue
Block a user