Only start offload worker thread when there's more than 1 core

pull/2956/head
cyqsimon 3 weeks ago
parent b4e3a84e1a
commit 1afe875717
No known key found for this signature in database
GPG Key ID: 1D8CE2F297390D65

@ -2,6 +2,7 @@ use std::collections::HashSet;
use std::env;
use std::io::IsTerminal;
use std::path::{Path, PathBuf};
use std::thread::available_parallelism;
use crate::{
clap_app,
@ -125,7 +126,9 @@ impl App {
// start building glob matchers for builtin mappings immediately
// this is an appropriate approach because it's statistically likely that
// all the custom mappings need to be checked
syntax_mapping.start_offload_build_all();
if available_parallelism()?.get() > 1 {
syntax_mapping.start_offload_build_all();
}
if let Some(values) = self.matches.get_many::<String>("ignored-suffix") {
for suffix in values {

Loading…
Cancel
Save