1

I'm using the plugin clang_complete in Vim. The plugin could complete C++ STL accurately. But its completion speed is unacceptable. Is there any way to improve the clang_complete's completion speed?

update:Yesterday I found this,and now the omnicppcomplete could basically meet my need ,so I decided to continue to use omnicppcomplete.vim. Thak you for your answers!!

Peeter Joot
  • 7,848
  • 7
  • 48
  • 82
hbxtght
  • 89
  • 2
  • 7

2 Answers2

0

Well i heard, that using libclang.so instead of clang executable is much faster. However for reliable completion, you need to ignore errors, and im kinda lost in using libclang api. Its really not that easy. I dont know, which version of clang_complete are you using, but there is follow up plugin called same, that is updated until now by some guy. He tried to use libclang and pre-filled databases for speedup - and not only for completing, but also for context sensitive navigating. See here: http://blog.wuwon.id.au/2011/10/vim-plugin-for-navigating-c-with.html

It actually does have some problems, as it doesnt work correctly, when there is something in code, that clang compiler doesnt like. it could be ignored by old clang_complete, but not this version(at least, when you are using libclang, you are free to use also the old clang executable).

majkl
  • 170
  • 1
  • 13
  • Thank you for your answer!I don't know why,but I can't open the link. – hbxtght Oct 26 '11 at 01:11
  • Well omnicomplete isnt bad, BUT, it doesnt know context. You will fall in troubles in bigger projects, if you will deal with more namespaces. – majkl Oct 26 '11 at 14:50
  • Ok, Maybe the clang_complete is better. Now I'm using the clang2.9. And it works much better than before except for still a little pause when I type . -> :: – hbxtght Oct 27 '11 at 04:38
  • I found this:https://github.com/tobig/clang_complete/downloads,and it takes about 0.2s to pop the completion menu. – hbxtght Oct 28 '11 at 10:47
0

If you're not using Clang 3.0 (rc) or trunk, you may be using slower code. This has recently been worked on, due to inacceptable performance, so just updating Clang might give you the boost you need.

rubenvb
  • 74,642
  • 33
  • 187
  • 332
  • Now I'm using clang3.1, But the situation becomes worse~ I feel slower than before.. – hbxtght Oct 25 '11 at 16:33
  • hbxtght: See [this discussion on the CLang mailing list](http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-October/017582.html), it's about the vim plugin, and how it's being improved. It's a known problem that's being worked on, but Clang's side seems to be near optimal, the remaining overhead is in the clang_complete plugin itself. – rubenvb Oct 26 '11 at 09:24
  • I try using clang2.9 and now the clang_complete works better than before. But when I type . -> or :: ,I still feel a little pause. – hbxtght Oct 27 '11 at 04:37