neovim/test/functional
vanaigr 4b02916334
perf(treesitter): use child_containing_descendant() in has-ancestor? (#28512)
Problem: `has-ancestor?` is O(n²) for the depth of the tree since it iterates over each of the node's ancestors (bottom-up), and each ancestor takes O(n) time.
This happens because tree-sitter's nodes don't store their parent nodes, and the tree is searched (top-down) each time a new parent is requested.

Solution: Make use of new `ts_node_child_containing_descendant()` in tree-sitter v0.22.6 (which is now the minimum required version) to rewrite the `has-ancestor?` predicate in C to become O(n).

For a sample file, decreases the time taken by `has-ancestor?` from 360ms to 6ms.
2024-05-16 16:57:58 +02:00
..
api fix(api): make getting explicit empty hl in virtual text work (#28697) 2024-05-12 05:39:33 +08:00
autocmd test: improve test conventions 2024-04-23 18:17:04 +02:00
core test: improve test conventions 2024-04-23 18:17:04 +02:00
editor test: improve test conventions 2024-04-23 18:17:04 +02:00
ex_cmds test: improve test conventions 2024-04-23 18:17:04 +02:00
fixtures NVIM v0.10.0 2024-05-16 14:34:32 +02:00
legacy vim-patch:9.1.0397: Wrong display with 'smoothscroll' when changing quickfix list (#28674) 2024-05-09 06:11:56 +08:00
lua fix(test): failure after version bump #28771 2024-05-16 05:33:04 -07:00
options test: improve test conventions 2024-04-23 18:17:04 +02:00
plugin refactor(lua): remove deprecated features #28725 2024-05-13 05:00:39 -07:00
provider test: improve test conventions 2024-04-23 18:17:04 +02:00
script docs(luacats): support backtick captured generic type 2024-05-07 14:33:14 +01:00
shada test: improve test conventions 2024-04-23 18:17:04 +02:00
terminal fix(tui): initialize clear attrs with current terminal background 2024-05-10 14:13:02 +02:00
treesitter perf(treesitter): use child_containing_descendant() in has-ancestor? (#28512) 2024-05-16 16:57:58 +02:00
ui refactor(api): nvim_win_xx_ns are EXPERIMENTAL 2024-05-12 23:53:24 +02:00
vimscript test: improve test conventions 2024-04-23 18:17:04 +02:00
example_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
preload.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
testnvim.lua fix(test): failure after version bump #28771 2024-05-16 05:33:04 -07:00