From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter navigation time grows as sqrt(line-number) Date: Fri, 18 Aug 2023 16:21:05 +0300 Message-ID: <5430a41f-fc60-4d34-229b-7f94db10485d@gutov.dev> References: <3E82D409-6903-4679-9031-939CA35791FF@gmail.com> <264EECA4-0920-4217-834C-19F9A58CEBBF@gmail.com> <2112821D-6A84-4AE7-BF7F-D26B4463A419@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14165"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: emacs-devel@gnu.org To: Yuan Fu , JD Smith Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 18 15:22:29 2023 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 1qWzQq-0003Wl-I9 for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Aug 2023 15:22:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWzQ2-000115-3E; Fri, 18 Aug 2023 09:21:38 -0400 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 1qWzPf-0000yW-57 for emacs-devel@gnu.org; Fri, 18 Aug 2023 09:21:15 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWzPc-0008ED-Ka for emacs-devel@gnu.org; Fri, 18 Aug 2023 09:21:14 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 324D1320095D; Fri, 18 Aug 2023 09:21:09 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 18 Aug 2023 09:21:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1692364868; x=1692451268; bh=FZOsCDPHUht/aQXppaS9zj5TwPubMkA59Y1 Y+/WscTA=; b=IO9E/kh2WpAYsuZxt+vBmuMYlgr6F/8aCXiNs4BS4AvXPphTXrh WPqDrxxKVcjpF86gMT9RCe+WkZVdenOW2rYt98lv1r6KZGphDhtx6j4ry1/hwWdE g8TJfzl/9StIFZZnD2O0k4WWxaGbm5it8u4mr1lxpxdNN0/kOJ8NOkNAtW9TBULU aTEFRyG1McGoM42OUlQuEFLUS+BEQJTRGjdPNQR7XpZaMjF61nD5r/HAXFDnrXg0 6qmy17kvBtTjcSnOg3kLE1awOOhyPSk2+glhHVb89utSjVKClEMbRkLr0oJCQ5zB J6y8N4sGsTEiLXt6jnqXD0cVdXvRSDMHjjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references: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= 1692364868; x=1692451268; bh=FZOsCDPHUht/aQXppaS9zj5TwPubMkA59Y1 Y+/WscTA=; b=2mLEcJYlhien/MZX3ULjephC1KHk6yp8H3D8vU+IdJ5wyxA4PGk Uu7oHh4ctMDFZa+lurKWQg+bF8YtUXrtji9BUikhfkxcRz/A7IBRZPLrImTGQwwi E7hFhSmKfW8xUKVRMiIhzIeWZLW5gDuP2qqbn3J3j3q2ZmbUsreXSPDTK8RLcbMY iUFTocMdVo8ccDkJoxbFvlFMWKLmAKRl2IsfoBhnxnXAimWTqHocY/EeRaA/KUOB RSP1AukbuGyvWiIl+pXpsxuAPy1cwPqgoNZMCIucK3Oqjdt0j9xpPxxOw8v/XIM4 zMMd5OfsU9mnwiPIN0P7csWK0APWNbxDnow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddufedgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Aug 2023 09:21:07 -0400 (EDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=64.147.123.25; envelope-from=dmitry@gutov.dev; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -62 X-Spam_score: -6.3 X-Spam_bar: ------ X-Spam_report: (-6.3 / 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, NICE_REPLY_A=-3.454, 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: 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308892 Archived-At: On 18/08/2023 08:20, Yuan Fu wrote: >>> I’m not too worried tho, because IIRC the absolute time is very short. The 100x variability doesn’t mean much if the 100x is still very fast. >> >> >> This is on a brand new fast machine, and 3ms is pretty slow for things that need to run dozens of times per keystroke (e.g. font-lock). > > Font-lock doesn’t need to find the parent of a node. So that hasn’t been a problem. In use-cases where finding the parent of a node is useful, 3ms hasn’t been a problem AFAIK. (Well, I guess indentation could benefit from a faster parent-finding function.) It could be unrelated, but someone on Reddit complained about the speed of rust-ts-mode's font-lock in a large enough file, and this mode's fontification rules contain treesit-node-parent calls.