From b228947b6863f5864b48bb3a7f3dcca921f58d0b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 14 Apr 2019 23:04:08 +0300 Subject: cleanup syntax --- docs/dev/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/dev/README.md') diff --git a/docs/dev/README.md b/docs/dev/README.md index 7bb323f3f..7fb5886c9 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md @@ -135,3 +135,13 @@ There's also two VS Code commands which might be of interest: There's an alias for this: `cargo jinstall-lsp`. * `Rust Analyzer: Syntax Tree` shows syntax tree of the current file/selection. + +# Profiling + +We have a built-in hierarchical profiler, you can enable it by using `RA_PROF` env-var: + +``` +RA_PROFILE=* // dump everything +RA_PROFILE=foo|bar|baz // enabled only selected entries +RA_PROFILE=*@3 // dump everything, up to depth 3 +``` -- cgit v1.2.3 From 5b7012318cdf5fb0bb8b01319270c1b4bf0311ee Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 14 Apr 2019 23:18:58 +0300 Subject: filter by time --- docs/dev/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/dev/README.md') diff --git a/docs/dev/README.md b/docs/dev/README.md index 7fb5886c9..d34ff96c8 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md @@ -105,7 +105,7 @@ figure out where logs go. Inside rust-analyzer, we use the standard `log` crate for logging, and `flexi_logger` for logging frotend. By default, log goes to stderr (the same as with `env_logger`), but the stderr itself is processed by VS Code. To mirror -logs to a `./log` directory, set `RA_INTERNAL_MODE=1` environmental variable. +logs to a `./log` directory, set `RA_LOG_DIR=1` environmental variable. To see stderr in the running VS Code instance, go to the "Output" tab of the panel and select `rust-analyzer`. This shows `eprintln!` as well. Note that @@ -143,5 +143,7 @@ We have a built-in hierarchical profiler, you can enable it by using `RA_PROF` e ``` RA_PROFILE=* // dump everything RA_PROFILE=foo|bar|baz // enabled only selected entries -RA_PROFILE=*@3 // dump everything, up to depth 3 +RA_PROFILE=*@3>10 // dump everything, up to depth 3, if it takes more than 10 ms ``` + +In particular, I have `export RA_PROFILE='*>10' in my shell profile. -- cgit v1.2.3