(vim profiling) VIM 256 colors mode, laggy php files
Asked Answered
W

1

6

I'm using 256-colors theme in vim (set t_Co=256) and all php files opens about 8 seconds.

  • It's my local dual-core machine
  • It doesn't depend on color scheme I used (zenburn, wombat, wombat256)
  • HTML, Python, JS or every else files opens momentary
  • It takes about 8 sec even to create new php files (:o newfile.php)
  • I've setting up my terminal correctly
  • Everything fine if I'm using 16 colors (set t_Co=16)

I really want to use 256-colors mode, it looks much prettier, but I can't get rid of this lags.

Wendolyn answered 22/8, 2010 at 20:13 Comment(6)
do you have the latest version? I has having delays when using versions after 7.2 (but before 7.3).Morville
yep, I have lags on 7.3 & 7.2, it strange, but gVim 7.2 works fineWendolyn
Try doing vim -c 'set verbosefile=./vim.log verbose=12' -c 'o newfile.php' -c 'set verbose=0' -c 'qa!', then gvim -c 'set verbosefile=./gvim.log verbose=12' -c 'o newfile.php' -c 'set verbose=0' -c 'qa!', then diff ./vim.log ./gvim.log. If there are any significant differencies (other than changed script numbers), paste both files somewhere. If not, try doing this with verbose=15. Or do this not with gvim, but with vim with t_Co=16 (or with any other configuration which does not cause troubles).Phenol
If after the previous step you have not found what causes trouble, try doing vim -c 'profile start ./vim.profile' -c 'profile func *' -c 'profile file *' -c 'o newfile.php' -c 'qa!', a table at the end of file ./vim.profile should give you information, about the function that caused trouble.Phenol
Many thanks, I found, that problem was caused by css highlight script by Chris Yip (vim.org/scripts/script.php?script_id=3220). After I delete it, everything works fine.Wendolyn
@andrew go ahead and answer your own question. Then you can select it as the correct answer. Seems a bit odd, but that's the accepted method of resolving self-answered questions.Mateusz
W
3

Right way to find what cause performance problems in VIM is to profile it or check debug output (optionally - comparing with vim setup without troubles).

Comparing debug output:

vim -c 'set verbosefile=./vim1.log verbose=12' -c 'command that causes problem' -c 'qa!'
vim -c 'set verbosefile=./vim2.log verbose=12' -c 'qa!'
diff ./vim1.log ./vim2.log

In some cases you can also increase verbose level up to 15

Profiling:

vim -c 'profile start ./vim.profile' -c 'profile func *' -c 'profile file *' -c 'command that causes problem' -c 'qa!'
Wendolyn answered 7/10, 2010 at 1:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.