Re: Cream unusably slow for some Vim scripts (e.g. TOhtml)
Cream is a free, easy-to-use configuration of the Vim text editor
Brought to you by:
digitect
From: Steve H. <dig...@mi...> - 2005-12-28 21:09:49
|
On Wed, 2005-12-28 at 16:13 -0400, BG - Ben Armstrong wrote: > On Wed, 2005-12-28 at 15:09 -0400, BG - Ben Armstrong wrote: > > If we could defeat most or all Cream autocmds during this > > expensive operation, only re-enabling them (and triggering them) > > when we are all done, the performance could be greatly improved. > > Taking a cue from our earlier performance problem report and your > suggestions about what to try, I devised a manual workaround: > > ^O:set eventignore=all > ^O:TOhtml > ^O:set eventignore= > > Then, to retrigger the BufEnter autocmds (e.g. filetype > detection/syntax highlighting,) I had to leave the newly created > html output buffer and re-enter it. Much better approach than my previous mail! > This time, the TOhtml conversion only took 25 seconds. Re-measuring > the same test in gvim, but without the set eventignore=all, it took > 27 seconds, so I must have made an error (or my test environment > wasn't "clean") the first time. Vim has some autocmds, maybe restrict those? > Neat trick. But it needs packaging. I'd hate to have to write a > Cream wrapper per expensive Vim function, but that's what it's > looking like to me, with my limited Vim skills. I think you're almost there. Just put those lines in a function. Then copy it into an add-on so it can be picked from a menu. One of these days this should get integrated into Cream's current Convert Text-to-HTML add-on. I wrote it to better reflect a document's leading whitespace and paragraph markings without just slamming the entire document into some pre tags. It would take some work though. > By the way, I tried disabling autocmds one group at a time: autocmd! > BufEnter *, autocmd! BufWinEnter *, etc. to narrow it down to a > specific group that was causing the most trouble, but I never did > find the culprit. (I probably wasn't patient enough and gave up too > early -- there are an awful lot of autocmds!) There are! I'm still suspicious of the filetype detection stuff. Cream relies almost entirely on Vim's detection architecture which usually re-examines the filename. But there are some window and highlighting management tasks in there, too. -- Steve Hall [ digitect mindspring com ] :: Cream... something good to put in your Vim! :: http://cream.sourceforge.net |