emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call for volunteers: add tree-sitter support to major modes


From: Yuan Fu
Subject: Re: Call for volunteers: add tree-sitter support to major modes
Date: Tue, 11 Oct 2022 11:18:26 -0700


> On Oct 11, 2022, at 9:56 AM, Daniel Martín <mardani29@yahoo.es> wrote:
> 
> Visuwesh <visuweshm@gmail.com> writes:
> 
>> 
>> 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].
> 
> 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.
> 
> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]