From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter navigation time grows as sqrt(line-number) Date: Thu, 17 Aug 2023 08:21:33 -0400 Message-ID: References: <3E82D409-6903-4679-9031-939CA35791FF@gmail.com> <32507689-3b2c-ccbf-dd14-e7bf0bed1ac7@gutov.dev> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) 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="4390"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 17 14:22:41 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 1qWc1Q-0000tx-Qs for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Aug 2023 14:22:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWc0d-0003og-AO; Thu, 17 Aug 2023 08:21:51 -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 1qWc0b-0003oF-GU for emacs-devel@gnu.org; Thu, 17 Aug 2023 08:21:49 -0400 Original-Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWc0Y-0004iP-4s for emacs-devel@gnu.org; Thu, 17 Aug 2023 08:21:49 -0400 Original-Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1bba7717d3bso5511181fac.1 for ; Thu, 17 Aug 2023 05:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692274905; x=1692879705; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r5UNmWxcuMc0oMhx8MnH6IorA8k2d4ZgDVG/1WU1rpo=; b=O50sUIPEaIuLM10d+1yK1KkNNT7dqI9kr0IHkY7Le4GxW+gvIKDIB/RWZuACRKa+iE cD+G2T0Q3OYgel33+hmVNDo8g+kHMxiiqYH/m4vawD2qpLhcFtNsCVcZuHooi7BSp3a9 T2SdGw0TxyUzC+JJFbK7+iSey6yTGI0xit8vHKzJJr+Pwq50WNUA/qbEYh4/lwQVK6mq LQSPmJtmIW8AyczOfdSlHf2zXJvLbb7sCBS9R0LPjEqBmuVGEESq7Eq6NbHBJ/R2zkle HIn6mot45oNNz6BiMdtMMH8kdIxqN125ldPd7TdPv12x25sCvaeczuetJqpucT+u/p+K tJzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692274905; x=1692879705; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r5UNmWxcuMc0oMhx8MnH6IorA8k2d4ZgDVG/1WU1rpo=; b=U9cLLX/19qbo4vLe0XBAZsRgrHwFyOarUIKdYOKGL/r3Y4BgtThC7Vd4eSrkgu//GR eddPZz2bCk2cD3dsVMVBLono89PrHyU0htj+ebefxIw27ZjnFuUhn7UNI7jxFEjhCv8h up0F6dCjjoiaiGEPPfO/MmZCNVqS3y+ij08LZzckzzLBmfO+S8ZqRTZECr4g6oWKmO+9 8NLF4lmYgP6CNK4DI3RalYMrY18xGVQBCYgB6W4LRpvMizbaxGY1RgiM3983mzS254gg STBy4lllPWTpgCtzXD1LOkdjP4GSAzzVak29oIW5aFS8jNPF31sKg4aYZOuQAB9kY5Ax nxlA== X-Gm-Message-State: AOJu0Yzm3yXjUyU1UP7AQKFH1277nBNEllS18yFFpSKOIdzl925g602q Dt3Rhb7cLIjbN+Cr1WU8v2E= X-Google-Smtp-Source: AGHT+IFFfRmwYML8dyhW9zfelMWZ6UoMFfqGLLKxIkSAnWS8djL+ILXMIw9I/ZfXgjAL24k8DOEguA== X-Received: by 2002:a05:6870:5623:b0:1bf:9f6:b810 with SMTP id m35-20020a056870562300b001bf09f6b810mr5519303oao.36.1692274904669; Thu, 17 Aug 2023 05:21:44 -0700 (PDT) Original-Received: from smtpclient.apple (cm-24-53-184-115.buckeyecom.net. [24.53.184.115]) by smtp.gmail.com with ESMTPSA id gm2-20020a0566382b8200b0039deb26853csm4958058jab.10.2023.08.17.05.21.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Aug 2023 05:21:44 -0700 (PDT) In-Reply-To: <32507689-3b2c-ccbf-dd14-e7bf0bed1ac7@gutov.dev> X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2001:4860:4864:20::36; envelope-from=jdtsmith@gmail.com; helo=mail-oa1-x36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:308858 Archived-At: Thanks for that, but I=E2=80=99m afraid I haven=E2=80=99t yet had time. = I provided the test code and target file in the hopes that others could = confirm the scaling behavior and then experiment with algorithm tweaks, = if anything obvious presented itself. > On Aug 17, 2023, at 6:56 AM, Dmitry Gutov wrote: >=20 > On 17/08/2023 07:01, JD Smith wrote: >> I=E2=80=99m unclear whether this is fundamental to the tree-sitter = parse/tree algorithm, or if the scaling comes from Emacs=E2=80=99 TS = implementation. It does vaguely remind me of similar scaling with an = old line-numbering algorithm, where lines were always being counted from = the beginning of the buffer, so very fast at the front, and very slow = near the end. >=20 > Have you tried my patch yet?