From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter indentation for js-mode & cc-mode Date: Fri, 28 Oct 2022 01:15:09 -0700 Message-ID: <425E0075-3F44-4832-BA2E-61E7D0A26FF4@gmail.com> References: <9AF8BFDC-C9A2-4AE5-A8D2-E6AA05DA3C91@gmail.com> <87k04lljh6.fsf@thornhill.no> <541CF451-6FAC-4531-A8AF-8C86FBB9D40B@thornhill.no> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="1738"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel , Stefan Monnier To: Theodor Thornhill Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 28 10:16:37 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 1ooKXc-0000IR-Pr for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Oct 2022 10:16:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooKWc-0000F0-RB; Fri, 28 Oct 2022 04:15:35 -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 1ooKWK-0000AB-1o for emacs-devel@gnu.org; Fri, 28 Oct 2022 04:15:32 -0400 Original-Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooKWH-00040M-SH for emacs-devel@gnu.org; Fri, 28 Oct 2022 04:15:15 -0400 Original-Received: by mail-pg1-x532.google.com with SMTP id s196so4232477pgs.3 for ; Fri, 28 Oct 2022 01:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=ydHV4KSmkRosurqyOIAwp1oQnhycvGAfatadryRTNJI=; b=aZDqimsdltzECUJ6Vu9fsl3dyeRq95A/mNGc6JjanDTCDtXerTwZFA7cUEhqUMfWmm a/17KLhMJssJ3mXoBX61wRhEWlgNP9wHomPSRUwg6u/OLtX+Y1dDzSmzk0lgaCpiVG1n 4pN9va5wr2RmAaqLD/dFSmAqEjBdHAa3riJyiMx+liJd6V3vnuOMAAL3CQ0SvNIP6pza Pn/RKO3/bvfC206gFB4ibr0gCnj3FB0S2cCGrviNngLJ9/ALMZDAr//Y7yNQudcdBO71 SXA4b9mz0WQxoPYMcjB+dx8sBBJ7vlhbuH1KYrXuDqmSKpTqHKZEOLx54bmHXU3zpkQ5 D3iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ydHV4KSmkRosurqyOIAwp1oQnhycvGAfatadryRTNJI=; b=hXRrxRT7vucRuSFmQfATRaLCD7rN3cDHOBHLVf6dOqe1NuwvBl4XGQvJ48Gi+8WRMp 1nNCmG2Kag1tRQWajxU1Zib+7IFQBU59quQ8WIAHhcb8fmFHqPVNSoTD0vnkAFvEBg/S vwx7RW1XqmgWjKjNJqpjFBOPI5M8FevNnKQaFeXMoSmoaltJdJnFvqSNYxcKrKXplZcy oFbBmvBlxef3JOtmlsSTpJx+nGn6ycN0jJFDMBrlvtVTI7cZtXp3c+YkcHJTU6L0FOfa Rf1NIlHsGuOqvjuQoqu7uAgUu4eoW+p+5vvyOWuSAwItLmSRDYMRiIRpa1uXxq3fH4kA tukQ== X-Gm-Message-State: ACrzQf17TEaKUq7VqNwr9RS5oKjTkBS3NAsy7tejvXFwLS0jVs2ffmXO tEoKC/Sm6Erak2YVe3r1nyE= X-Google-Smtp-Source: AMsMyM65PmPTuNP0MmteN+YbdJ/fB4q1F5cYM3HxKyS4wC/1ruGjdJFRrgQ39QDoliXQWZIMX7YawA== X-Received: by 2002:a63:485f:0:b0:458:764a:2224 with SMTP id x31-20020a63485f000000b00458764a2224mr45054777pgk.620.1666944911418; Fri, 28 Oct 2022 01:15:11 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id n1-20020a170902e54100b0016be834d54asm2434523plf.306.2022.10.28.01.15.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2022 01:15:11 -0700 (PDT) In-Reply-To: <541CF451-6FAC-4531-A8AF-8C86FBB9D40B@thornhill.no> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=casouri@gmail.com; helo=mail-pg1-x532.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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298664 Archived-At: >=20 >>> looking up way to much the root of the tree, but you know the = internals >>> here better than me. Is this something we can optimize away? See = the >>> attached report at the bottom. >>=20 >> This is very strange, I need to look into it. >>=20 >=20 > I'm happy to provide more info and profiling, as well as testing if = need be!=20 I just tried running treesit-buffer-root-node and treesit-node-at 10000 = times in the end of buffer and they are pretty fast, so I don=E2=80=99t = know why the benchmark says 99% time is spent in = treesit-buffer-root-node. Could you share the benchmark code and test = file? Thanks! Yuan=