Wednesday, June 23, 2010

Performance issues when script does not prevent reloading

Usually, scripts have a few lines at the top that look like:

if exists("b:script_loaded")
finish
endif

let b:script_loaded = 1

As I was developing a new script, I disabled this to be able to reload
changes quickly. However, very soon I noticed a really great performance
degradation for things like keyword completion, switching buffers, and
even just typing.

I did not expect that because all the script does is set some variables,
defines a couple of functions, mappings, etc. It's located in .vim/plugin/
dir.

It seems like it would only run once on startup and, when sourced, it'd
just overwrite the existing variables, function defs and so on, so I'm
not exactly sure how that would cause such an extreme performance hit
(in fact I don't see how it would cause any at all).

It's not really an issue but I'm just curious as to what is the cause.
Thanks!

-ak

--
Python plugins for vim: outliner, todo list, project manager, calendar,
expenses tracker, sortable table, and more |
http://lightbird.net/pysuite/

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: