Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/oxc_linter/src/service/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ impl Runtime {

// Create a sorted copy of paths for processing
let mut sorted_paths: Vec<_> = paths.iter().cloned().collect();
sorted_paths.par_sort_unstable_by(|a, b| Path::new(b).cmp(Path::new(a)));
// Sort by path length descending - longer paths tend to be deeper in the directory tree.
// This achieves the "deeper paths first" heuristic described above in O(1) per comparison.
sorted_paths.par_sort_unstable_by(|a, b| b.len().cmp(&a.len()));

// The general idea is processing `sorted_paths` and their dependencies in groups. We start from a group of modules
// in `sorted_paths` that is small enough to hold in memory but big enough to make use of the rayon thread pool.
Expand Down
Loading