mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
perf(events): store autocommands in flat vectors (#23256)
Instead of nested linked lists, store autocommands in a flat, contiguous kvec_t, with one kvec_t per event type. Previously patterns were stored in each node of the outer linked list, so they can be matched only once on repeating patterns. They are now reference counted and referenced in each autocommand, and matching is skipped if the pattern repeats. Speeds up creation and deletion, execution is not affected. Co-authored-by: ii14 <ii14@users.noreply.github.com>
This commit is contained in:
@@ -1885,8 +1885,7 @@ static char *do_one_cmd(char **cmdlinep, int flags, cstack_T *cstack, LineGetter
|
||||
// avoid that a function call in 'statusline' does this
|
||||
&& !getline_equal(fgetline, cookie, get_func_line)
|
||||
// avoid that an autocommand, e.g. QuitPre, does this
|
||||
&& !getline_equal(fgetline, cookie,
|
||||
getnextac)) {
|
||||
&& !getline_equal(fgetline, cookie, getnextac)) {
|
||||
quitmore--;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user