aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2025-01-01 11:33:45 -0800
committerChristian Clason <ch.clason+github@icloud.com>2025-01-07 16:43:45 +0100
commitd9ee0d2984e5fc30cb032785d32f42c72c7e64e1 (patch)
treee4f3c6e9be47fb20dcef3cfa0253da7699e50ce7 /runtime/doc
parentb67fcd0488746b079a3b721ae4800af94cd126e1 (diff)
downloadrneovim-d9ee0d2984e5fc30cb032785d32f42c72c7e64e1.tar.gz
rneovim-d9ee0d2984e5fc30cb032785d32f42c72c7e64e1.tar.bz2
rneovim-d9ee0d2984e5fc30cb032785d32f42c72c7e64e1.zip
perf(treesitter): don't fetch parser for each fold line
**Problem:** The treesitter `foldexpr` calls `get_parser()` for each line in the buffer when calculating folds. This can be incredibly slow for buffers where a parser cannot be found (because the result is not cached), and exponentially more so when the user has many `runtimepath`s. **Solution:** Only fetch the parser when it is needed; that is, only when initializing fold data for a buffer. Co-authored-by: Jongwook Choi <wookayin@gmail.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/news.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index b7606e65f5..17f85154c2 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -287,6 +287,8 @@ PERFORMANCE
highlighting.
• LSP diagnostics and inlay hints are de-duplicated (new requests cancel
inflight requests). This greatly improves performance with slow LSP servers.
+• 10x speedup for |vim.treesitter.foldexpr()| (when no parser exists for the
+ buffer).
PLUGINS