From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Wed, 1 Apr 2020 06:49:45 +0300 Message-ID: <4a9d6bb2-458d-89b0-5389-d1f883ef24a1@yandex.ru> References: <83o8sf3r7i.fsf@gnu.org> <2E218879-0F24-4A20-B210-263C8D0BEEA4@gmail.com> <838sjh2red.fsf@gnu.org> <83369o3bvb.fsf@gnu.org> <83imik1qbq.fsf@gnu.org> <835zek1kpv.fsf@gnu.org> <83v9mkz5oo.fsf@gnu.org> <83pncsym6l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="125927"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cc: casouri@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, akrl@sdf.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 01 05:50:30 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 1jJUOb-000Wfk-MX for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 05:50:29 +0200 Original-Received: from localhost ([::1]:46692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJUOa-0002ka-Mv for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Mar 2020 23:50:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38445) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJUNy-0002GO-Iq for emacs-devel@gnu.org; Tue, 31 Mar 2020 23:49:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJUNx-0002K4-Dt for emacs-devel@gnu.org; Tue, 31 Mar 2020 23:49:50 -0400 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:35790) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJUNx-0002Fu-4w; Tue, 31 Mar 2020 23:49:49 -0400 Original-Received: by mail-wm1-x335.google.com with SMTP id i19so5555328wmb.0; Tue, 31 Mar 2020 20:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BBCQvIUvPnMDIjO9ysKt4MpVGBrJn7l0fL/gfbJtLis=; b=GF7292Zgg1zeA4SGol2lsK/DudCeL3gKakDqoqUcqG5hJTmgqqJxZXsQQAsHfqNt7N VR4QpbGiEcpxHSu61a8qUmrTTfXLHQqoOGk77bFd6AECwMDw8sDifHQvYu/6lZ51npBs lRzaqzKClEUKF8SUBzZoCEn6x1meopPB8aOZsNYNVJ4vwtlAasZQID9+uZsyoH+kPCnt HmhTBKokCm9RgPlnoy1AcxKFwQsh0HOMsJkVv2irqnrqgvLcbQpDyYqW2T0AYwbb3hhf He1T3AhK+NgyPSfZA1wQIBVKW7GqcdK7fRRgecojmQQxp0fODth1SQDeKfuJplhrea7q WKXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BBCQvIUvPnMDIjO9ysKt4MpVGBrJn7l0fL/gfbJtLis=; b=M3ocaO1WFJQwHOoDwmPycBg+4MxtF3I/pQjNJQVhGFswVi4kDk+8J9MYoUZMKLI+DI hYeitTLQMPdGar31S8CB0CtvN569dnjH0Cbl82/jK06GrBbuQvOTHhicWgRD6dTDl+hV W8zNNSYOZYZSShCGalZJ2rAcrCvrTv/8rZ0eBUSCUPVSm30YJq/y5q+5EOeAUFSUihTq ogKxyJDMGafMA2VqjDpuMJpFR7Qpz77Nb/QVUOUnJrXG3+hQyR8vtLMuhuS4GF/QKTwt TL8fHCEMmsKzpZBOBKG/CW1xm+a02w6kuJeRYOywEFmDP3UIVLsVWdm4j8duDuBBZH4J y/OQ== X-Gm-Message-State: AGi0PubItiwbpTCWQv50B2bZZxzMqvDf+Txs6g3qsrNXBuh6TqkpY58p UpHpijpDKBeZnceQ3XRLo+AtTXQF X-Google-Smtp-Source: APiQypKKOnbr6dEwGtNeFy1QAjv5/cdRwsVVbTzJvbvg410o+CXz9NKbReP/yM60Nl7WOjFsIwKUvQ== X-Received: by 2002:a7b:c343:: with SMTP id l3mr2143338wmj.38.1585712987549; Tue, 31 Mar 2020 20:49:47 -0700 (PDT) Original-Received: from [192.168.0.2] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id h2sm883447wmb.16.2020.03.31.20.49.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Mar 2020 20:49:46 -0700 (PDT) In-Reply-To: <83pncsym6l.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 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:246181 Archived-At: On 01.04.2020 05:28, Eli Zaretskii wrote: >> Cc: monnier@iro.umontreal.ca, casouri@gmail.com, akrl@sdf.org, >> emacs-devel@gnu.org >> From: Dmitry Gutov >> Date: Tue, 31 Mar 2020 22:50:43 +0300 >> >>>> (benchmark 1 '(progn (find-file "src/xdisp.c") (goto-char (point-max)))) >>>> >>>> => Elapsed time: 1.940401s (0.376140s in 6 GCs) >>> This doesn't measure the redisplay (which happens after the above >>> command returns). >> >> Which means that the current state of affairs is even slower. > > No, it means that whatever delay we will have with parsing the entire > buffer is _in_addition_ to whatever you measured. Probably not. IIUC, most of this 1.2 measured delay is CC Mode doing the preliminary parsing. That phase would be replaced by TreeSitter's full buffer parse, which supposedly takes a comparable amount of time. The redisplay phase will most likely be faster because by then the correct AST is available, and computing highlighting based on it is supposedly something that TreeSitter does quickly and well.