Comments (5)
Thank you Andy for fixing the issue. And generally thanks for developing and supporting this small yet quite useful plugin!
I can confirm the fix does its job, I've no more performance issues with the plugin.
from vim-gitgutter.
There's no performance problem for me which makes it difficult for me to determine when it is fixed.
Please could you profile gitgutter? This will show exactly where the slowdown is occurring.
I'm surprised, though, because 84bc2d6 simply replaced one built-in function – split()
– with another – strridx()
– and two array slices.
from vim-gitgutter.
Hello Andy,
Here are two profile logs, for the normal & slow versions. In both cases I opened nvim, then run 4x O<ESC>u
on a file in git repo, and closed it. Hope that it helps!
gitgutter_profile_normal.log
gitgutter_profile_slow.log
from vim-gitgutter.
Some more info that could help you to debug the issue.
I put the debug statements
call gitgutter#debug#log(base)
call gitgutter#debug#log(bpath)
and here is what I get in the log:
Old version (before the fix)
0.956426 function <SNR>74_on_exit_nvim[2]..gitgutter#diff#handler[1]:
0.956426 @@ -255,0 +256,2 @@ function! gitgutter#utility#base_path(bufnr)^@@@ -256,0 +259 @@ function! gitgutter#utility#base_path(bufnr)
1.484144 CursorHold Autocommands for "*"..function gitgutter#process_buffer[23]..gitgutter#diff#run_diff[55]..gitgutter#utility#base_path[7]:
1.484144
1.485144 CursorHold Autocommands for "*"..function gitgutter#process_buffer[23]..gitgutter#diff#run_diff[55]..gitgutter#utility#base_path[8]:
1.485144 autoload/gitgutter/utility.vim
New version (slow)
0.959054 function <SNR>74_on_exit_nvim[2]..gitgutter#diff#handler[1]:
0.959054 @@ -256,0 +257,3 @@ function! gitgutter#utility#base_path(bufnr)
1.207955 CursorHold Autocommands for "*"..function gitgutter#process_buffer[23]..gitgutter#diff#run_diff[55]..gitgutter#utility#base_path[8]:
1.207955 :autoload/gitgutter/utility.vim
1.208686 CursorHold Autocommands for "*"..function gitgutter#process_buffer[23]..gitgutter#diff#run_diff[55]..gitgutter#utility#base_path[9]:
1.208686 autoload/gitgutter/utility.vim
The notable difference is in base
var, which is set to :autoload/gitgutter/utility.vim
in the new (slow) version. I suspect the non-empty base
triggers some additional code that causes slow down.
from vim-gitgutter.
Thanks for digging into that.
You're right: I was using substring indexes incorrectly which meant that base
wasn't empty when it should have been, which was triggering additional code including a system()
call.
I think I've got it right now...!
from vim-gitgutter.
Related Issues (20)
- b:gitgutter_was_enabled error anytime you run `saveas newfile.txt` HOT 1
- Undefined variable: b:source_window when staging from a floating preview menu HOT 2
- g:gitgutter_close_preview_on_escape is broken when exists('*nvim_open_win') HOT 2
- vim-gitgutter clobbers v:shell_error via autocmd ShellCmdPost HOT 7
- File renames aren't handled properly HOT 13
- Error detected while processing CursorHold HOT 14
- g:gitgutter_diff_base () is invalid HOT 4
- Neovim Nightly Issue HOT 2
- Neovim now prefers extmarks to signs HOT 3
- errors when file path includes colons HOT 3
- Branch rename breaking installations? HOT 2
- g:gitgutter_diff_base () is invalid HOT 10
- Performance issues with big files in the repository HOT 3
- cursorline highlighting doesn't work with gitgutter HOT 3
- gutter colors not showing change on correct line HOT 1
- No hunks (file possibly recognized as binary file) HOT 5
- GitGutterLineHighlightsToggle doesn't update immediately on neovim HOT 3
- GG doesn't show file changes when in a worktree HOT 3
- key map expr needs more backslashes? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-gitgutter.