From: Yuan Fu Date: Wed, 15 Jun 2022 19:15:24 +0000 (-0700) Subject: ; * src/treesit.c: Add comment to explain design decisions. X-Git-Tag: emacs-29.0.90~1905 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a4d7bcccba5ffaafb769d8f517c159d64b0887bc;p=emacs.git ; * src/treesit.c: Add comment to explain design decisions. --- diff --git a/src/treesit.c b/src/treesit.c index 8d0f2e517af..88d5ea91223 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -89,6 +89,14 @@ along with GNU Emacs. If not, see . */ - lisp/emacs-lisp/cl-preloaded.el & data.c & lisp.h for parser and node type. + We don't parse at every keystroke. Instead we only record the + changes at each keystroke, and only parse when requested. It is + possible that lazy parsing is worse: instead of dispersed little + pauses, now you have less frequent but larger pauses. I doubt + there will be any perceived difference, as the lazy parsing is + going to be pretty frequent anyway. Also this (lazy parsing) is + what the mailing list guys wanted. + Because it is pretty slow (comparing to other tree-sitter operations) for tree-sitter to parse the query and produce a query object, it is very wasteful to reparse the query every time