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..e7694e8d19f 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. + +*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. + +* 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`