> In a performance sensitive function I recently used vim's `and(arg1, > arg2)` and `or(arg1, arg2)` since I couldn't find `&`,`|`. Got me > wondering what the difference is between a function and vim9 > instruction execution; so I was interested in taking a look at how > this instruction executes. > > I guess if invoking `and()` involves setting up a stack frame then the > difference is pretty big.
Unfortunately, yes, a function call has quite a bit of overhead. Especially now that expressions are converted to byte code when compiling. A function call still has to handle all kinds of possible side effects. I wonder if we can make a difference between calling a user defined function and a builtin function, since the latter should have predictable behavior. -- hundred-and-one symptoms of being an internet addict: 251. You've never seen your closest friends who usually live WAY too far away. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20220521205239.B627E1C0473%40moolenaar.net.
