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: Thu, 17 Aug 2023 17:36:32 +0300 Message-ID: References: <87v8ddsqwe.fsf@web.de> <797b4f1c-222e-14c0-c802-6f23090c9c1f@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35257"; 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 To: Felix Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 17 16:37:30 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 1qWe7t-0008zH-W8 for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Aug 2023 16:37:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWe77-0005Vv-8G; Thu, 17 Aug 2023 10:36:41 -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 1qWe75-0005VW-Po for emacs-devel@gnu.org; Thu, 17 Aug 2023 10:36:39 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWe73-0002aE-9R for emacs-devel@gnu.org; Thu, 17 Aug 2023 10:36:39 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2E6175C00B2; Thu, 17 Aug 2023 10:36:35 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 17 Aug 2023 10:36:35 -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= 1692282995; x=1692369395; bh=nq7X+xD+YSUwJ1aF5CY8rYMJ7HGts5i54Hi tr9KnY8E=; b=FbLg7aUC7Z2vKa/qofg7M1sCMBXwWqqBkcUrU0cycUgn52flYL/ JQV5EYdLdfcOa8iadR7BPw3p7JDTyC9semxME+OJO/wYJTmprC96VtkmXo49LlZB 7Vws2FgcUg+8ZOAXomBlY5aiAQdf6L7S2XeEdiNuqap7gc0i+HjT5tmZw7K5l5PI /tb54W8UmJ949xAdVK1Vg7B5dpP93XXRLTYbJ1NzvBR6JiV8I9k9tki+C26rD5cC hINpWKTNSs51r95p09gvMOEZqFOn1M32uxv4CJ7NO4F9JbHAZtLV99dv8TzAILRV rHcsU2dIStORxp0KH8GyP3mRBLGcso6i/RQ== 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= 1692282995; x=1692369395; bh=nq7X+xD+YSUwJ1aF5CY8rYMJ7HGts5i54Hi tr9KnY8E=; b=kPQ/IBzynroc3JOSMh4rG3krVNoq6cQ8m+ONr3Db7f4+pCxDZ5p 1Kkvlb/x+9OCo9Gq0QoHDY8chFsUmgVETRVI3LeahfKzrge7uqrrxOxwe2GSrFW4 3QMdTtBErErk48ipZPQYRFSkYdEdDI7yi0J1OzNQIg8/FOJRtOpacpPdEmKfUWte Ui8khz8f5SveF8h7IWMdc5AoOEWTK2s470oyI7Ypp7R4PorUY5sXfzG3RXuWuPr/ DXjcqkImx1pgtdYYHW8HcniJ3W1P6WV7/DHC4lFfZzDyayPIJV+yD0lYKNnBjT8D WNHomsXmLOcX7LjNvGZbYa35SjObD+DE7GA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudduuddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuhffvvehfjggtgfesth ejredttdefjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehg uhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpeejgeeivdefgffhudetueevjefgfe elleetvddtfeevkeehveffueeuhfehjeffhfenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Aug 2023 10:36:34 -0400 (EDT) Content-Language: en-US In-Reply-To: <797b4f1c-222e-14c0-c802-6f23090c9c1f@gutov.dev> Received-SPF: pass client-ip=66.111.4.25; envelope-from=dmitry@gutov.dev; helo=out1-smtp.messagingengine.com X-Spam_score_int: -67 X-Spam_score: -6.8 X-Spam_bar: ------ X-Spam_report: (-6.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, NICE_REPLY_A=-4.01, 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 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:308872 Archived-At: On 17/08/2023 17:25, Dmitry Gutov wrote: > On 17/08/2023 17:08, Felix wrote: >> Hi, >> >> I tried that patch, and it crashes emacs whenever i try to scroll inside >> a tree-sitter managed buffer. >> >> GNU Emacs 30.0.50 (build 22, x86_64-pc-linux-gnu, GTK+ Version >> 3.24.38, cairo version 1.17.8) of 2023-08-17 >> >> compiled with pgtk running on wayland. > > Thanks for testing. Does that happen in any ts mode, or some particular > ones? > > If you run Emacs from the terminal, could you post the error backtrace? > > (Please keep emacs-devel in Cc). For my part, I don't see it crash when scrolling (in ruby-ts-mdoe or js-ts-mode, including larges files), but the test scenario by JD does make it crash. When running under GDB, the backtrace simply looks like this: #0 0x00007ffff63bf93d in ts_tree_root_node (self=0x0) at lib/src/tree.c:36 #1 0x00007ffff63a54e5 in ts_node_parent (self=...) at lib/src/node.c:462 #2 0x00005555557f0d17 in Ftreesit_node_parent (node=XIL(0x5555574908c5)) at treesit.c:1906 #3 0x000055555576f62b in eval_sub (form=) at eval.c:2511 #4 0x000055555576f987 in Fsetq (args=) at eval.c:483 #5 0x000055555576f368 in eval_sub (form=) at eval.c:2462 #6 0x000055555576ff75 in Fprogn (body=XIL(0)) at eval.c:436 ...