gabesoft / vim-ags

Silver searcher plugin for vim
183 stars 12 forks source link

Great plugin but too slow. #3

Closed mohitleo9 closed 9 years ago

mohitleo9 commented 9 years ago

Hey, this is a really cool feature, reduces the clutter in search results a lot. But it is way too slow as compared to Ag.vim . I haven't looked at the code, but I assume it's doing some post processing in vimscript to the results, and trying to create a buffer with locations, would be cool if you could somehow make it faster (maybe push the processing to ag and vim location buffer?)

gabesoft commented 9 years ago

Yea, I noticed that too. I'll try to make it faster. For the record though, it only gets slow for large amounts of results returned from ag. So, as a workaround, having more specific searches that return less results will be more performant.

gabesoft commented 9 years ago

So, I looked into it and it's not the processing of the results, but the system call itself that takes longer. The reason is that Ags.vim returns more lines than Ag.vim. However, you can set the g:ags_agcontext to 1 to get less lines and better performance.

gabesoft commented 9 years ago

I've added a fix to allow for setting ag args to 0. So setting this value let g:ags_agcontext = 0 will result in performance similar to Ag.vim

gabesoft commented 9 years ago

Fixed by ae1497e343b55d8765005abf7dff086480c9abf9