document performance issues and add to bug report template (#1111)

This commit is contained in:
Alexander Courtis 2022-03-27 20:52:51 +11:00 committed by GitHub
parent bd23c88608
commit ba121f0244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 4 deletions

View File

@ -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"

View File

@ -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")

View File

@ -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`