From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?B?VHXhuqVuLUFuaCBOZ3V54buFbg==?= Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Thu, 2 Apr 2020 11:36:20 +0700 Message-ID: References: <83369o1khx.fsf@gnu.org> <83imijz68s.fsf@gnu.org> <831rp7ypam.fsf@gnu.org> <86wo6yhj4d.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="51374"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stephen Leake , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 02 06:37:17 2020 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 1jJrbR-000DI0-7L for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 06:37:17 +0200 Original-Received: from localhost ([::1]:33316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJrbQ-000843-7r for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 00:37:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57438) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJrap-0007bO-M0 for emacs-devel@gnu.org; Thu, 02 Apr 2020 00:36:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJrao-0001mG-EA for emacs-devel@gnu.org; Thu, 02 Apr 2020 00:36:39 -0400 Original-Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:44786) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJrao-0001lZ-6p for emacs-devel@gnu.org; Thu, 02 Apr 2020 00:36:38 -0400 Original-Received: by mail-pf1-x443.google.com with SMTP id b72so1152439pfb.11 for ; Wed, 01 Apr 2020 21:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=CjbM0jVsu966iB9vjHCScu4SDyaw6S3w/gOqVBGIgaQ=; b=D6lN7DpkxwCGuxRDlIntosb9bgtPKIRW/Fb/xmYwIiDojALkZKu9mDGqcxPhpVQjYf g4gZnJ2WtMDGJF4HJh+KF46tIUytUjdvDbQGJ4A8WtQieVCYEUE0WWNftfvuVXmYoZps hr9/YPNQjuz5YVtuJXY3qyVxYHojDroVGC87mf+XWcfjA9a65WBZT3k7Ysp5L0oldBtq bTbLPMbn2WUaW5ZnyH/UUq09ncIn0f6nGXAHDPoU8DXhbfMnTUsFLfyyB7dKtTHXgLIT mdmN3thIMWboHaO5ldj7kfdEXLFCvQUzHMSB1GyVP4lS9s3XWlthToARanJrFj2j4nJW jWmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=CjbM0jVsu966iB9vjHCScu4SDyaw6S3w/gOqVBGIgaQ=; b=Gn29riVA6gNmRkfjIWOzb2zopsOGCS60jqu9RtM9rfGBOrOGEXG20gYskYVzFjOYLR ke6Ix0hVX2nn1yRTGEGz0A3G/E0u1l3zHxM6nxYbz7JST+JcLcL8AlthCNihOv0/8RNJ +VX752dw1D9EaWwlo/UF5bRV7tEDl94y4leqvFn9RCkSlRM87FdBdNeDkXJ07s21w+eO GKhlsC3x/sjd8xqbzimZ3A76P2mrjrpG2jSTjfWXgKFxjPNi7cq+82+e1e+qqQYGuaXK uKztqh1D8M1h4/iRhQ01G9M5L7U6IA+ixelsQCpOElOi0GXld3cflQWFAnJLSXrngVHO XbHQ== X-Gm-Message-State: AGi0PuafJft4QavTfL4kmcfMQKFPeyf1iFB5pIomMSCBN7TSZGOegJM7 kbXegHC073iogfWxBRSEEw3OVZ4+f3JIzjtgpgA= X-Google-Smtp-Source: APiQypIIzdzWs2Dl3kENZ/lBYDA6mn90dlVLc6YlGL6B9Grw9MX21bukqOzrCkpA/Ji0Bl9febNpUXkRd4SasmcxQak= X-Received: by 2002:a63:9210:: with SMTP id o16mr1694727pgd.442.1585802196815; Wed, 01 Apr 2020 21:36:36 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:246237 Archived-At: > If the GC is the worry, we can use a function which encodes the > buffer using a given coding-system and returns a malloc'd array of bytes. > If we are talking about a function exposed to dynamic modules, then we will also need to expose another function to free that byte array, because the dynamic module may use a different allocator. It's probably better to ask the caller to prepare that array, like what `copy_string_contents' does. > >>> It's stored in a buffer-local variable. I haven't measured the memory > >>> they take. Memory is released when the tree object is garbage-collect= ed > >>> (it's a `user-ptr'). > > Is it an elisp structure (or accesible from elisp)? Have you written > > code that traverses it to provide faces and indentation? > > According to https://github.com/tree-sitter/tree-sitter/issues/222 the > parse tree takes around 10 times the size of the source text. At least > that's for tree-sitter's own parse-tree; not sure how that relates to > emacs-tree-sitter's yet. > emacs-tree-sitter adds 16 bytes for reference counting and 8 bytes for checking concurrent modifications (because nodes are also exposed to Lisp as objects). That's negligible I think. -- Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n Software Engineer