mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
Add profiling calls
This commit is contained in:
parent
86bc4d20b3
commit
be679a02ab
2 changed files with 6 additions and 0 deletions
|
@ -26,6 +26,7 @@ use crate::{
|
|||
to_proto::url_from_abs_path,
|
||||
Result,
|
||||
};
|
||||
use ra_prof::profile;
|
||||
|
||||
#[derive(Eq, PartialEq, Copy, Clone)]
|
||||
pub(crate) enum Status {
|
||||
|
@ -122,6 +123,7 @@ impl GlobalState {
|
|||
}
|
||||
|
||||
pub(crate) fn process_changes(&mut self) -> bool {
|
||||
let _p = profile("GlobalState::process_changes");
|
||||
let mut fs_changes = Vec::new();
|
||||
let mut has_fs_changes = false;
|
||||
|
||||
|
|
|
@ -14,9 +14,11 @@ use crate::{
|
|||
lsp_ext,
|
||||
main_loop::Task,
|
||||
};
|
||||
use ra_prof::profile;
|
||||
|
||||
impl GlobalState {
|
||||
pub(crate) fn update_configuration(&mut self, config: Config) {
|
||||
let _p = profile("GlobalState::update_configuration");
|
||||
let old_config = mem::replace(&mut self.config, config);
|
||||
if self.config.lru_capacity != old_config.lru_capacity {
|
||||
self.analysis_host.update_lru_capacity(old_config.lru_capacity);
|
||||
|
@ -114,6 +116,7 @@ impl GlobalState {
|
|||
});
|
||||
}
|
||||
pub(crate) fn switch_workspaces(&mut self, workspaces: Vec<anyhow::Result<ProjectWorkspace>>) {
|
||||
let _p = profile("GlobalState::switch_workspaces");
|
||||
log::info!("reloading projects: {:?}", self.config.linked_projects);
|
||||
|
||||
let mut has_errors = false;
|
||||
|
@ -302,6 +305,7 @@ pub(crate) struct SourceRootConfig {
|
|||
|
||||
impl SourceRootConfig {
|
||||
pub(crate) fn partition(&self, vfs: &vfs::Vfs) -> Vec<SourceRoot> {
|
||||
let _p = profile("SourceRootConfig::partition");
|
||||
self.fsc
|
||||
.partition(vfs)
|
||||
.into_iter()
|
||||
|
|
Loading…
Reference in a new issue