From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59415: 29.0.50; [feature/tree-sitter] c-ts-mode fails to fontify a portion of a large C file Date: Sun, 20 Nov 2022 22:56:12 +0100 Message-ID: <87tu2tthmr.fsf@thornhill.no> References: <83v8n94ij9.fsf@gnu.org> <87k03pwgf6.fsf@thornhill.no> <83h6yt4c12.fsf@gnu.org> <87v8n9qscd.fsf@thornhill.no> <87pmdhqqni.fsf@thornhill.no> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6437"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, 59415@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 20 22:57:30 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1owsJc-0001Sk-Nz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Nov 2022 22:57:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owsJH-0007iW-LT; Sun, 20 Nov 2022 16:57:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owsJF-0007iH-SN for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 16:57:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owsJC-0000xw-Bg for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 16:57:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owsJC-0003Ez-19 for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 16:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Nov 2022 21:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59415 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Eli Zaretskii , Bug Report Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.166898138812412 (code B ref -1); Sun, 20 Nov 2022 21:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Nov 2022 21:56:28 +0000 Original-Received: from localhost ([127.0.0.1]:44810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owsId-0003E8-QQ for submit@debbugs.gnu.org; Sun, 20 Nov 2022 16:56:28 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:51920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owsIc-0003E0-28 for submit@debbugs.gnu.org; Sun, 20 Nov 2022 16:56:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owsIb-0007gB-E7 for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 16:56:25 -0500 Original-Received: from out2.migadu.com ([2001:41d0:2:aacc::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owsIZ-0000vs-DG; Sun, 20 Nov 2022 16:56:25 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1668981380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JoIiS+VKopRMXz+AznSWQrxAbWttmlr4PfNMX8FI+T0=; b=zfgwYH53DiCZNUS1Nq8XNTIY4hB9FCjqotsy5cNVzhVSRBvf0I0LGYrOzf1VEs03EiUno9 zYPzNDBI6Gx1NGAHGoE1NBLU+Xytc7UKxwAvyU5RbaFYD3QxAup03hoQ6OR28eGbiARrYh SlfTA3PJ5qL0ms2DL16sWtA2bXcX942eRYBBsqIGSFnFb0Pqo9besMEPdGdTrPaEvzW7gf t6FmLPZ6pbugBzj4Uo8zgkTy9jFlEYVp4KeQ13OyAZCX6GKLI5ahMjM+83ucuLhtnPnZFK gKUcMGfJ1ieyfu/BYUdkiBw/Dgb8P9GiYvlcbVE/qXynAGF0rvVLTEDLIHArPg== In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=theo@thornhill.no; helo=out2.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248483 Archived-At: >>=20 >> I appreciate the explanation. I think getting the root is a bit >> excessive. I got the same results as you in the capture. Maybe reuse >> the treesit-defun-type-regexp, and default to root if none found? > > I tried the "top-level node=E2=80=9D approach, and it didn=E2=80=99t help= in > package-rrc.c: the top-level node (a function definition) is still too > large (spans 7680306-9936062). Since the case I described in the > comment against using treesit-node-on is the exception rather than the > norm, maybe we can go the other way around: use treesit-node-on first, > and if the node seems too small (by some heuristic), enlarge it to > some degree. > Makes sense! BTW, should the chunk-size of jit-lock be up for discussion again? I ran the benchmarks from this thread [0] on this file, and it seems like increasing the chunk-size from 1500 to 4500 by 500 increments makes it average from 2 seconds to 1.65. The density of that file absolutely is a concern performance-wise. Theo [0]: https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg00538.html