Jason Felice wrote: > I've been thinking about the recent thread about vimscript and performance > (after optimizing the heck out of a plugin that does a lot of text > processing), and I'm curious about vim's reparsing of statements in > functions and while loops and such for each execution. > > Is there something about the syntax that prevents caching parses? Or > another mechanism? Or is it just that nobody's stepped up to do this? Or > something else, maybe it's not a good idea?
I have been thinking about it many times, but never got to actually start with it. The idea would be to store the parser result somehow (would depend on the command what to store). And then associate it with the saved raw line, so that it gets freed when no longer used. Should work both for loops and for functions. It will require more memory, but these days that's hardly something to worry about. It could be combine with more clever and generic parsing, but that is going to be a lot of work. Also, storing the parser output will require more work, thus we need a benchmark to make sure there is enough gain. -- "When I die, I want a tombstone that says "GAME OVER" - Ton Richters /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" 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 --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
