Reply to message «Re: optwin.vim - setlocal on global options ? ...», 
sent 00:36:46 31 January 2011, Monday
by Marc Weber:

> Do you have a rough estimate about how long it takes on such slow
> machines? Maybe I can can benchmark alternative solutions to find out
> how much slower they would be.
My solution without most of window changes is at least 10% faster then 
old solution. But it will be good if you improve my benchmark 
(taking into account the fact that I measured 
(vim_startup+optwin+vim_shutdown), 
not only (optwin)).
Second attempt:

(zyx:~/tmp/vim) % for (( I=0 ; I<100 ; I++ )) ; do vim -u NONE -c 'let 
rt=reltime()' -c 
'so /usr/share/vim/vim73/optwin.vim' -c "call 
writefile([reltimestr(reltime(rt))], 
'ow$I')" -c 'qa!' ; done
(zyx:~/tmp/vim) % cat ow* | sort | head -n 1
  0.014335
(zyx:~/tmp/vim) % for (( I=0 ; I<100 ; I++ )) ; do vim -u NONE -c 'let 
rt=reltime()' -c 
'so optwin.vim' -c "call writefile([reltimestr(reltime(rt))], 'owm$I')" -c 
'qa!' ; done
(zyx:~/tmp/vim) % cat owm* | sort | head -n 1
  0.010008

Now 30% improvement (which is expected). With your code that finds existing 
option window it is just 0.8% faster (though 0.010008-0.009929=7.9e-5 is 
probably 
below the precision). It should make more difference with more windows opened 
or more autocommands set then with «-u NONE».

Original message:
> Excerpts from Bram Moolenaar's message of Sun Jan 30 22:07:54 +0100 2011:
> > We can have a long discussion about using :setlocal for a global option
> > should fail or not.
> 
> I think it should because it strengthens the user awareness about cope of
> options.
> 
> Anyway: Is there a way to view/set both: local and global settings for
> those options which are both?
> 
> > The user would get here to change option values, keep the header as
> > short as possible.
> 
> I totally missed that you can change options that way. I never missed it
> either. By reading the code I assumed its a view only.
> 
> > I don't think this window should repeat what's in the help files.  A
> > line pointing beginners to the help for options would be better.
> 
> Agreed.
> 
> > On slow machines opening the option window can be really slow.
> 
> I'd assume people using Vim on very slow machines know the options they
> use very often anyway - probably they have also mapped them.
> 
> Do you have a rough estimate about how long it takes on such slow
> machines? Maybe I can can benchmark alternative solutions to find out
> how much slower they would be.
> 
> Eg pressing <cr> on binary options could be enough to toggle them - no
> need to edit them - no need to show the "alternative" value.
> 
> The logic is pretty simple.
> 
> Thanks for making me understand what that page is about.
> 
> Marc Weber

Attachment: signature.asc
Description: This is a digitally signed message part.

Raspunde prin e-mail lui