-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: eager load some data to improve performance (#2829)
- Loading branch information
Showing
10 changed files
with
67 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
use xx::regex; | ||
use crate::cli::version::VERSION; | ||
use crate::plugins::VERSION_REGEX; | ||
use once_cell::sync::Lazy; | ||
use std::path::PathBuf; | ||
use std::sync::Mutex; | ||
|
||
/// initializes slow parts of mise eagerly in the background | ||
pub fn early_init() { | ||
rayon::spawn(|| { | ||
regex!(""); | ||
}); // initialize regex library | ||
let _ = &*VERSION_REGEX; | ||
}); | ||
rayon::spawn(|| { | ||
let _ = &*VERSION; | ||
}) | ||
} | ||
|
||
pub static CONFIG_FILES: Lazy<Mutex<Vec<PathBuf>>> = Lazy::new(|| Mutex::new(Vec::new())); | ||
|
||
/// run after SETTING has been loaded | ||
pub fn post_settings() { | ||
// if std::env::var("EAGER").is_err() { | ||
// return; | ||
// } | ||
// rayon::spawn(|s| { | ||
// s.spawn(|_| { | ||
// // let _ = load_toolset(); | ||
// }); | ||
// }); | ||
} | ||
pub fn post_settings() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters