Add Rayon for parallel file checking
Some checks failed
Core Repos/Rack/pipeline/head There was a failure building this commit
Some checks failed
Core Repos/Rack/pipeline/head There was a failure building this commit
Now we're almost entirely IO bound, rather than having to wait to read and search through files one at a time.
This commit is contained in:
@@ -10,6 +10,7 @@ fn main() {
|
||||
mod rack {
|
||||
use ::rack::config::Config;
|
||||
use ::rack::filematch::*;
|
||||
use rayon::prelude::*;
|
||||
use std::fs::{self, DirEntry, File};
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
@@ -121,7 +122,7 @@ mod rack {
|
||||
|
||||
let mut results = traversal
|
||||
.entries
|
||||
.iter()
|
||||
.par_iter()
|
||||
.filter_map(|e| self.check_file(&e.path).ok())
|
||||
.filter(|mat| mat.matches.len() > 0)
|
||||
.collect::<Vec<FileMatch>>();
|
||||
|
||||
Reference in New Issue
Block a user