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: Call for volunteers: add tree-sitter support to major modes Date: Tue, 11 Oct 2022 11:18:26 -0700 Message-ID: <13B0EDEF-E51A-42C7-9C66-0465448CAC12@gmail.com> References: <83czb1jrm3.fsf@gnu.org> <878rlo7on0.fsf@thornhill.no> <83o7uki5ol.fsf@gnu.org> <87tu4c5g9j.fsf@thornhill.no> <87k057j7gn.fsf@yahoo.com> <8D3026E9-D8A4-46EC-816B-1F7A3458DC02@gmail.com> <87czaykj2o.fsf@yahoo.com> <83fsfug75q.fsf@gnu.org> <87r0zeiysu.fsf@yahoo.com> <83bkqig4xl.fsf@gnu.org> <87pmeycyo9.fsf@gmail.com> 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="23727"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Visuwesh , Eli Zaretskii , Po Lu , theo@thornhill.no, acm@muc.de, emacs-devel@gnu.org, jostein@kjonigsen.net To: =?utf-8?Q?Daniel_Mart=C3=ADn?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 11 20:34:29 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 1oiK5F-0005sx-Bc for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 20:34:29 +0200 Original-Received: from localhost ([::1]:55420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiK5E-0000xb-6R for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 14:34:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiJpy-00072i-Cd for emacs-devel@gnu.org; Tue, 11 Oct 2022 14:18:42 -0400 Original-Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]:47016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oiJpw-0003Vt-S2; Tue, 11 Oct 2022 14:18:42 -0400 Original-Received: by mail-vs1-xe2f.google.com with SMTP id a2so9509886vsc.13; Tue, 11 Oct 2022 11:18:40 -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=TA9qe7BygI95uQwt0ZDWSFXyM29/IlfCMKYOE0XwQYU=; b=aqeF/7wopH5SBM5Q2sfOepS5yuYjMB+4mU8MTFYQZoBrGDnMqtWjzoceYGEfgWmpFN ax0M9IuHfVJGdHJE/PSBD1jh2n3oETD/zc02vTdrmPG295cAK9r23c6+6Eg2Jk1Sstz7 fk+mmBI8p/zmDChO6bn/FcW+MhbcmmfdF/auIzlTg6ISYpZo2mY0SqPrjvHdY9d0scb7 eWmgKQZWx1zoec+lk3lYDtHOirj/ezwfUSbbVLBPCEIu/hwKk/Ww1S+YgQkZQhDtRPrr cvcIvhY5K0IRH9ooS0Wv2HA4tIQfELznDGKQMaZdQYHPrTMj1apjZPKQaKO30yFtojO/ jmqw== 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=TA9qe7BygI95uQwt0ZDWSFXyM29/IlfCMKYOE0XwQYU=; b=keHGxyUKdy8JZZWvx3PWWa47zKIc2d7SwQN/RMnU3vMo5pc33//sgM5g/P8eoZ0hem gaExmwdvob6bDXhyXjO2YciAWkOADSIuD0ryM3p5m1nkflkjQFAbg+wSaoNTf9AjEWEy nLNEncXEw2LX7DN33ERc1lsD9Qr8hw39nUg/oiJsRXgNsQllAHwsmVA6TiKyW6OQOxO4 VZvEVswAaMgPNfJN7STTiyvapdmmQADnLTOiyX31PJ5f4SB+dXvMiVJAUucoA3kof4WK Zs8M7zwTZG9vUJ0dRx2iTe697n3CIjNFkf0BS3BO0SWbCAFUvU1GDbMSFoJoGqqWHCcu 7vIA== X-Gm-Message-State: ACrzQf3PgL6uteWS1D8F4MeaJ/gliPZAYwNeMgWgC7YH3EM0W+SD/BIR V0/qDrYkjGHKHu75byMItMwqr/h9bVfp6w== X-Google-Smtp-Source: AMsMyM4QydmOzm6oTdOU0yUzv7zpJeb+sfc+uyNYr6zYKXvdQ5xyyMsY+uMzPCSFUrsOuQUmlLUQdw== X-Received: by 2002:a05:6a00:b8d:b0:543:6731:8b6c with SMTP id g13-20020a056a000b8d00b0054367318b6cmr26555720pfj.80.1665512308657; Tue, 11 Oct 2022 11:18:28 -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 a1-20020aa78e81000000b00540e1117c98sm9373074pfr.122.2022.10.11.11.18.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Oct 2022 11:18:28 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::e2f; envelope-from=casouri@gmail.com; helo=mail-vs1-xe2f.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" Xref: news.gmane.io gmane.emacs.devel:297520 Archived-At: > On Oct 11, 2022, at 9:56 AM, Daniel Mart=C3=ADn = wrote: >=20 > Visuwesh writes: >=20 >>=20 >> I've read the rest of this thread and understand the argument but how >> memory hungry does Emacs get when enabling tree-sitter? As far as I >> vaguely remember from the original tree-sitter inclusion discussion, >> tree-sitter used about the same memory as the buffer did for smallish >> files. Even more vaguely, I remember opening xdisp.c with = tree-sitter >> enabled shot up the memory usage to an unacceptable limit by my >> computer's standards. >> As someone with a mere 4G of RAM and 4G of swap space, I'm wondering = if >> enabling tree-sitter will make my laptop even more memory hungry than = it >> already can be when stressed [1]. >=20 > In my preliminary tests with Emacs 29, Emacs -Q (macOS GUI app) starts > at around 48 MB of RAM. When I (require 'treesit), memory usage = climbs > to about 57 MB. If I open a big Python file [1] and enable = Tree-sitter > for the buffer, memory stays around 60-65 MB after a few scroll > operations and basic editing. I can't test with xdisp.c as we don't > have C Tree-sitter support, AFAIK. >=20 > I think memory usage will vary depending on how we people use the > library, but I haven't seen any noticeable impact on memory usage > compared to a standard Emacs session. Tree-sitter uses about 10x the buffer size to store the parse tree. You = can set treesit-max-buffer-size to inhibit usage of tree-sitter on large = buffers. Yuan=