add --perf cli param (#4391)

* add `--perf` cli param

* clippy

* fixed 2 `cp` tests on windows
This commit is contained in:
Darren Schroeder
2022-02-09 16:08:16 -06:00
committed by GitHub
parent fc88a8538b
commit f275644e13
11 changed files with 301 additions and 73 deletions

View File

@ -1,4 +1,6 @@
use crate::is_perf_true;
use crate::utils::{eval_source, report_error};
use log::info;
use nu_protocol::engine::{EngineState, Stack, StateDelta, StateWorkingSet};
use std::path::PathBuf;
@ -22,6 +24,9 @@ pub(crate) fn read_plugin_file(engine_state: &mut EngineState, stack: &mut Stack
eval_source(engine_state, stack, &contents, &plugin_filename);
}
}
if is_perf_true() {
info!("read_plugin_file {}:{}:{}", file!(), line!(), column!());
}
}
pub(crate) fn read_config_file(engine_state: &mut EngineState, stack: &mut Stack) {
@ -63,6 +68,9 @@ pub(crate) fn read_config_file(engine_state: &mut EngineState, stack: &mut Stack
}
}
}
if is_perf_true() {
info!("read_config_file {}:{}:{}", file!(), line!(), column!());
}
}
pub(crate) fn create_history_path() -> Option<PathBuf> {