From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter (severe performance issues together with linum-mode) Date: Fri, 19 Aug 2022 08:01:27 +0200 Message-ID: References: <7e24d0aa-9980-6204-5064-5a92963ae7bd@secure.kjonigsen.net> Reply-To: jostein@kjonigsen.net Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------zu3RotoMmjjQ0oLDJLILxfyg" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21892"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Cc: "Ergus via Emacs development discussions." , =?UTF-8?B?VHXhuqVuLUFuaCBOZ3V54buFbg==?= , Markus Triska , Theodor Thornhill , dgutov@yandex.ru To: Yuan Fu , jostein@kjonigsen.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 19 08:04:42 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oOv7Y-0005TU-5A for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Aug 2022 08:04:41 +0200 Original-Received: from localhost ([::1]:41974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOv7X-0001ks-4q for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Aug 2022 02:04:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOv4Z-0000Ek-Vj for emacs-devel@gnu.org; Fri, 19 Aug 2022 02:01:39 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:43287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOv4X-0007HU-TM for emacs-devel@gnu.org; Fri, 19 Aug 2022 02:01:35 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CF8B35C01A7; Fri, 19 Aug 2022 02:01:31 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Aug 2022 02:01:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:sender:subject:subject:to:to; s=fm3; t= 1660888891; x=1660975291; bh=oaNpOz2uZnimQtj471twkvoq1oAJ5+3W+pa bG3LFRtI=; b=RwbSUOqp9y5FwwYstJro7kZxBYo1ZwpuV6DhVG9NFzsw+hMJ/mI pqWtJ0KrS6YRNjqKO5j7+6NQ28/xluR5IzQOg/vit6jIb/0xntBrxkaDr5V9mM4f bqL3VInq81Cg6wG5HMGQcZy0m4/ht/p570651lY+Mx1lsL9OUHWu7qbQVytkMzi3 5vq9fmgJFxoZvjX4DCOkZ3dQhJ+53PkMfSfn1p/vL08oPaa+B+RIqtrwVN9eVdOA aakPNfmDzv525ZUmnsRTl4+KCcX2kw6Fb0FiguV/fYg2fC2iTOo49zVO18F2TnuS k5QmiLW8pcicCUyHMFF3DCjbOUYBgv7rzwA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1660888891; x=1660975291; bh=oaNpOz2uZnimQ tj471twkvoq1oAJ5+3W+pabG3LFRtI=; b=hP6I45NSHHRR7nqxFvsutDwcs0rQl ImzqIoDZJr1+4q1RpQM2MaBdW8C22zP6Y2RNOcHXAi9XdXz1FpOTBg7Pqhp9qzo3 ftQzlmFZ7B8bAKJG0WBLfuGKPqgVdV0JrOonY0spejUnzR0snXiQ4s818GNuxlQi /ZV/43haQ75x90AfzLfqE01XjRySNj7SAyIVbevEK5mEQngnhXPExBJX2FU9blM/ 6G/JNP6anADmxq72lFqbP1eQMz+4OnpCkPJ/vjaw35zWjLkX0Ayk8eNXMriQMA+B 9I9azE1qKbSLA24IEMN9gk7t6jR7OvHad2ERyfon1e8f2FTVEuL11Xriw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeitddguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfrhfuvfevfhfhjgesrgdtreertdefjeenucfhrhhomheplfho shhtvghinhgpmfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjoh hnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepheffteffjefgtefglefhgedt jeehieekjeffjefgheejheeffefgvdevteetveehnecuffhomhgrihhnpehkjhhnihhgsh gvnhdrnhhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepjhhoshhtvghinhesshgvtghurhgvrdhkjhhonhhighhsvghnrdhnvght X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Aug 2022 02:01:30 -0400 (EDT) Content-Language: en-GB In-Reply-To: Received-SPF: pass client-ip=66.111.4.25; envelope-from=jostein@secure.kjonigsen.net; helo=out1-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293624 Archived-At: This is a multi-part message in MIME format. --------------zu3RotoMmjjQ0oLDJLILxfyg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 18.08.2022 11:44, Yuan Fu wrote: > > Good news, the slowness can be easily resolved by compiling the query pattern in csharp-mode-font-lock-settings-1 (this is a recent addition to treesit). > > Yuan Thanks for the reply and thanks for looking into this. I can confirm that by compiling the query like you suggested, and replacing linum-mode with nlinum-mode, I'm not experiencing any performance issues any more! To avoid issues like this... Should perhaps the function treesit-query-capture (in treesit.c) emit a warning/message when encountering non-compiled queries? That way writing more performant major-modes would be more self-explanatory, resulting in a better, faster Emacs for everyone. -- Vennlig hilsen *Jostein Kjønigsen* jostein@kjonigsen.net 🍵 jostein@gmail.com https://jostein.kjønigsen.no --------------zu3RotoMmjjQ0oLDJLILxfyg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 18.08.2022 11:44, Yuan Fu wrote:

Good news, the slowness can be easily resolved by compiling the query pattern in csharp-mode-font-lock-settings-1 (this is a recent addition to treesit).

Yuan

Thanks for the reply and thanks for looking into this.

I can confirm that by compiling the query like you suggested, and replacing linum-mode with nlinum-mode, I'm not experiencing any performance issues any more!

To avoid issues like this... Should perhaps the function treesit-query-capture (in treesit.c) emit a warning/message when encountering non-compiled queries?

That way writing more performant major-modes would be more self-explanatory, resulting in a better, faster Emacs for everyone.


--------------zu3RotoMmjjQ0oLDJLILxfyg--