From 7e54ba91bf423ac0e2297a3096e34fd15a5234a7 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 27 Mar 2022 15:55:01 +1100 Subject: [PATCH 1/2] document performance issues and add to bug report template --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- README.md | 29 ++++++++++++++++++++++++++- doc/nvim-tree-lua.txt | 3 +-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0e79a42bbed..483b8535739 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -5,7 +5,7 @@ body: - type: markdown attributes: value: | - Before reporting: search [existing issues](https://github.com/kyazdani42/nvim-tree.lua/issues) and make sure that nvim-tree is updated to the latest version. + Before reporting: search [existing issues](https://github.com/kyazdani42/nvim-tree.lua/issues) and make sure that nvim-tree is updated to the latest version. If you are experiencing performance issues, please [enable profiling](https://github.com/kyazdani42/nvim-tree.lua#performance-issues) and attach the logs. - type: textarea attributes: label: "Description" diff --git a/README.md b/README.md index 93ad9ab1b06..24940e9018d 100644 --- a/README.md +++ b/README.md @@ -334,10 +334,37 @@ You can toggle the help UI by pressing `g?`. ## Diagnostic Logging -You may enable diagnostic logging and a file `nvim-tree-HH:MM:SS-username.log` will be created in `$XDG_CACHE_HOME/nvim`, usually `~/.cache/nvim`, containing logs from that nvim session. See `:help nvim-tree.log`. +You may enable diagnostic logging and a file `nvim-tree.log` will be created in `$XDG_CACHE_HOME/nvim`, usually `~/.cache/nvim`, containing logs from that nvim session. See `:help nvim-tree.log`. The files may become large and numerous, so it is advised to turn on logging to diagnose an issue or while reporting a bug, then turn it off. +## Performance Issues + +If you are experiencing performance issues with nvim-tree.lua, you can enable profiling in the logs. It is advisable to enable git logging at the same time, as that can be a source of performance problems. + +```lua +log = { + enable = true, + truncate = true, + types = { + git = true, + profile = true, + }, +}, +``` + +Please attach `$XDG_CACHE_HOME/nvim/nvim-tree.log` if you raise an issue. + +### Tips + +* If you are using fish as an editor shell (which might be fixed in the future), try set `shell=/bin/bash` in your vim config. + +* Try manually running the git command (see the logs) in your shell e.g. `git --no-optional-locks status --porcelain=v1 --ignored=matching -u`. + +* Huge git repositories may timeout after the default `git.timeout` of 400ms. Try increasing that in your setup if you see `[git] job timed out` in the logs. + +* Try temporarily disabling git integration by setting `git.enable = false` in your setup. + ## Screenshots ![alt text](.github/screenshot.png?raw=true "kyazdani42 tree") diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 5704878c036..e300768e8f9 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -479,8 +479,7 @@ Here is a list of the options available in the setup call: *nvim-tree.log* |log|: configuration for diagnostic logging - - |log.enable|: enable logging to a file `nvim-tree-HH:MM:SS-username.log` - in $XDG_CACHE_HOME/nvim + - |log.enable|: enable logging to a file `$XDG_CACHE_HOME/nvim/nvim-tree.log` type: `boolean` default: `false` From e660f2acb872efd0689859fb6539b50ef7508a9e Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 27 Mar 2022 16:00:23 +1100 Subject: [PATCH 2/2] document performance issues and add to bug report template --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24940e9018d..e7694e8d19f 100644 --- a/README.md +++ b/README.md @@ -355,7 +355,7 @@ log = { Please attach `$XDG_CACHE_HOME/nvim/nvim-tree.log` if you raise an issue. -### Tips +*Performance Tips:* * If you are using fish as an editor shell (which might be fixed in the future), try set `shell=/bin/bash` in your vim config.