diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-14 23:21:12 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-14 23:21:12 +0100 |
commit | 546d9be2a7bf7b3942c125f922a01321aea6ad26 (patch) | |
tree | 7323905a2e0efe7fefb029c8d049987df6a6462f /docs/dev/README.md | |
parent | e1a2649aff0a9387fb14646a56cb652061bc42ec (diff) | |
parent | 247ac265f1e7f2d812e6f9174d48ceef45465b91 (diff) |
Merge #1146
1146: Moar profiling r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'docs/dev/README.md')
-rw-r--r-- | docs/dev/README.md | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/dev/README.md b/docs/dev/README.md index 7bb323f3f..d34ff96c8 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -105,7 +105,7 @@ figure out where logs go. | |||
105 | Inside rust-analyzer, we use the standard `log` crate for logging, and | 105 | Inside rust-analyzer, we use the standard `log` crate for logging, and |
106 | `flexi_logger` for logging frotend. By default, log goes to stderr (the same as | 106 | `flexi_logger` for logging frotend. By default, log goes to stderr (the same as |
107 | with `env_logger`), but the stderr itself is processed by VS Code. To mirror | 107 | with `env_logger`), but the stderr itself is processed by VS Code. To mirror |
108 | logs to a `./log` directory, set `RA_INTERNAL_MODE=1` environmental variable. | 108 | logs to a `./log` directory, set `RA_LOG_DIR=1` environmental variable. |
109 | 109 | ||
110 | To see stderr in the running VS Code instance, go to the "Output" tab of the | 110 | To see stderr in the running VS Code instance, go to the "Output" tab of the |
111 | panel and select `rust-analyzer`. This shows `eprintln!` as well. Note that | 111 | panel and select `rust-analyzer`. This shows `eprintln!` as well. Note that |
@@ -135,3 +135,15 @@ There's also two VS Code commands which might be of interest: | |||
135 | There's an alias for this: `cargo jinstall-lsp`. | 135 | There's an alias for this: `cargo jinstall-lsp`. |
136 | 136 | ||
137 | * `Rust Analyzer: Syntax Tree` shows syntax tree of the current file/selection. | 137 | * `Rust Analyzer: Syntax Tree` shows syntax tree of the current file/selection. |
138 | |||
139 | # Profiling | ||
140 | |||
141 | We have a built-in hierarchical profiler, you can enable it by using `RA_PROF` env-var: | ||
142 | |||
143 | ``` | ||
144 | RA_PROFILE=* // dump everything | ||
145 | RA_PROFILE=foo|bar|baz // enabled only selected entries | ||
146 | RA_PROFILE=*@3>10 // dump everything, up to depth 3, if it takes more than 10 ms | ||
147 | ``` | ||
148 | |||
149 | In particular, I have `export RA_PROFILE='*>10' in my shell profile. | ||