vim-ruby feels too slow
dougkearns at gmail.com
Wed Apr 12 04:25:17 EDT 2006
Sorry for the slow response.
On Wed, Apr 05, 2006 at 01:56:37PM -0700, Eric Hodel wrote:
> I remember first using vim with ruby highlighting and indenting on a
> Pentium 133 Laptop with 40MB of memory something like four years ago.
That'd be before I ruined it. ;-)
> I remember it being slow, but it was a Pentium 133 with limited
> memory. I didn't expect much.
> Now I have a 1.5GHz G4 powerbook with 2GB of memory.
> vim feels slower now than it did on that Pentium 133.
The highlighting is certainly slower than it was back then - it's doing
> I know that the indenting and highlighting are vastly improved for
> vim, but it doesn't seem that it should be this slow. Sometimes
> opening a ruby file pegs my CPU for five to ten seconds (usually one
> of the 100k internal Rails files).
Can you send me an example?
> Here's a semi-scientific concrete example that just shows starting
> up. I'll ignore editing because that's much more difficult to
> quantify, but editing can be just as slow in certain sections of
> files that take a long time to open.
> To start vim on my machine takes about 1/3 of a second, at best 1/5
> of a second:
This seems awfully slow to me...
> $ time vim -c ':q'
> real 0m0.216s
> user 0m0.070s
> sys 0m0.110s
> $ time vim -c ':q'
> real 0m0.318s
> user 0m0.125s
> sys 0m0.153s
> I have a test suite with 391 lines in it for 13k:
> $ wc test/controllers/entry_controller_test.rb
> 391 917 13181 test/controllers/entry_controller_test.rb
> There's really nothing fancy in the file. Just a class with a bunch
> of methods, a couple of Hashes and strings and so-on.
> If I move all the ruby-specific vim-ruby files aside
You don't have any of the distributed files in $VIMRUNTIME?
<snip - 'performance' data>
FWIW, I'm not too surprised by these numbers. Do the other similar
syntax files perform significantly faster for you?
> For real punishment I can give you r2ctestcase.rb from ruby2c.
Can you forward this one to me, please?
> $ wc r2ctestcase.rb
> 1351 3522 51231 r2ctestcase.rb
> $ time vim -c ':q' r2ctestcase.rb
> real 0m3.985s
> user 0m2.788s
> sys 0m0.498s
> In case I'm actually doing something stupid in my .vimrc, here it
> is. I don't believe I've changed it substantially since I started
> using vim.
I can't see anything obvious in there but you can always compare it to
vim -u NONE
More information about the vim-ruby-devel