High CPU usage on a particular file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

High CPU usage on a particular file

Kirt-2

I have a cpp file that is of moderate size, 693 lines long, with no
lines
longer than 80 characters. When I start typing quickly the CPU usage
goes up
to 50% and vim lags badly. It appears every operation is also very
slow. This only
+happens on one file. I observe this in the gui or without the gui.
I've tried to
comment everything out of my .vimrc file but I still have the problem.
I'm
using vim 7.1.138 under Ubuntu 8.04. It is driving me crazy. It is so
bad
that I'm tempted to edit that one file outside of vim. I know
unthinkable!
Any help would be appreciated.

Thanks a ton in advance,

Kirt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: High CPU usage on a particular file

Tim Chase

> I have a cpp file that is of moderate size, 693 lines long,
> with no lines longer than 80 characters. When I start typing
> quickly the CPU usage goes up to 50% and vim lags badly. It
> appears every operation is also very slow. This only +happens
> on one file. I observe this in the gui or without the gui.
> I've tried to comment everything out of my .vimrc file but I
> still have the problem. I'm using vim 7.1.138 under Ubuntu
> 8.04. It is driving me crazy. It is so bad that I'm tempted to
> edit that one file outside of vim.

A couple things to try, some of which may provide information
that point to the culprit.

- what type of file is it?

   :set ft?

- do you have any strange plugins loaded?

   :scriptnames

- do the problems get better when you turn off syntax highlighting?

   :syn off

- do the problems only occur in INSERT mode, or do they happen
merely navigating around the file?

- are there performance hot-spots, especially involving possible
searches for matching chars? (like parens, braces, or brackets)

- does it happen if you start a raw/naked vim session:

    vim -u NONE myfile.ext

I've had similar problems, but most frequently when doing
syntax-highlighting on files with long lines (some XML files are
notoriously bad, all on one line).

Answers to the above questions should help folks here guide you
in the right direction.

-tim



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: High CPU usage on a particular file

Richard Hartmann
In reply to this post by Kirt-2

Try starting vim with

  vim -u NONE -U NONE

Does it still happen? If yes, can you send the file in question
to the list? It would probably help if you kept a copy of said
file in case you manage to edit it in a way to get rid of the
symptoms.


Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: High CPU usage on a particular file

Kirt-2
In reply to this post by Tim Chase

Thank you so much for your advise. It was one of my plugins, the
python-ifold.c.vim plugin to be specific. I discarded it as the
problem earlier because it is suppose to be a plugin for python files.
It only happens on that one cpp file and something I did to the file
made it stop having the problems. I had to go back to earlier
revisions in order to diagnose the problem. I still don't know what is
wrong with it but I will pass it by the plugin author.

On Jul 16, 1:47 pm, Tim Chase <[hidden email]> wrote:

> > I have a cpp file that is of moderate size, 693 lines long,
> > with no lines longer than 80 characters. When I start typing
> > quickly the CPU usage goes up to 50% and vim lags badly. It
> > appears every operation is also very slow. This only +happens
> > on one file. I observe this in the gui or without the gui.
> > I've tried to comment everything out of my .vimrc file but I
> > still have the problem. I'm using vim 7.1.138 under Ubuntu
> > 8.04. It is driving me crazy. It is so bad that I'm tempted to
> > edit that one file outside of vim.
>
> A couple things to try, some of which may provide information
> that point to the culprit.
>
> - what type of file is it?
>
>    :set ft?
>
> - do you have any strange plugins loaded?
>
>    :scriptnames
>
> - do the problems get better when you turn off syntax highlighting?
>
>    :syn off
>
> - do the problems only occur in INSERT mode, or do they happen
> merely navigating around the file?
>
> - are there performance hot-spots, especially involving possible
> searches for matching chars? (like parens, braces, or brackets)
>
> - does it happen if you start a raw/naked vim session:
>
>     vim -u NONE myfile.ext
>
> I've had similar problems, but most frequently when doing
> syntax-highlighting on files with long lines (some XML files are
> notoriously bad, all on one line).
>
> Answers to the above questions should help folks here guide you
> in the right direction.
>
> -tim
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: High CPU usage on a particular file

Kirt-2
In reply to this post by Tim Chase

Thank you so much for your advise. It was one of my plugins, the
python-ifold.c.vim plugin to be specific. I discarded it as the
problem earlier because it is suppose to be a plugin for python files.
It only happens on that one cpp file and something I did to the file
made it stop having the problems. I had to go back to earlier
revisions in order to diagnose the problem. I still don't know what is
wrong with it but I will pass it by the plugin author.

On Jul 16, 1:47 pm, Tim Chase <[hidden email]> wrote:

> > I have a cpp file that is of moderate size, 693 lines long,
> > with no lines longer than 80 characters. When I start typing
> > quickly the CPU usage goes up to 50% and vim lags badly. It
> > appears every operation is also very slow. This only +happens
> > on one file. I observe this in the gui or without the gui.
> > I've tried to comment everything out of my .vimrc file but I
> > still have the problem. I'm using vim 7.1.138 under Ubuntu
> > 8.04. It is driving me crazy. It is so bad that I'm tempted to
> > edit that one file outside of vim.
>
> A couple things to try, some of which may provide information
> that point to the culprit.
>
> - what type of file is it?
>
>    :set ft?
>
> - do you have any strange plugins loaded?
>
>    :scriptnames
>
> - do the problems get better when you turn off syntax highlighting?
>
>    :syn off
>
> - do the problems only occur in INSERT mode, or do they happen
> merely navigating around the file?
>
> - are there performance hot-spots, especially involving possible
> searches for matching chars? (like parens, braces, or brackets)
>
> - does it happen if you start a raw/naked vim session:
>
>     vim -u NONE myfile.ext
>
> I've had similar problems, but most frequently when doing
> syntax-highlighting on files with long lines (some XML files are
> notoriously bad, all on one line).
>
> Answers to the above questions should help folks here guide you
> in the right direction.
>
> -tim
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---