From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Fri, 4 Jun 2021 12:59:45 +0200 Message-ID: References: <831r9iw473.fsf@gnu.org> <87h7ieyma7.fsf@gmail.com> <83wnr9vrpj.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) 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="33010"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ubolonton@gmail.com, dancol@dancol.org, theo@thornhill.no, =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 04 13:00:50 2021 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 1lp7ZK-0008NW-8z for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 13:00:50 +0200 Original-Received: from localhost ([::1]:34178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp7ZJ-0003C1-8X for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 07:00:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp7YP-0002Wc-KQ for emacs-devel@gnu.org; Fri, 04 Jun 2021 06:59:53 -0400 Original-Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:34420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lp7YO-0004Y4-4E; Fri, 04 Jun 2021 06:59:53 -0400 Original-Received: by mail-wr1-x42a.google.com with SMTP id q5so8892323wrm.1; Fri, 04 Jun 2021 03:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OvNpsxNmrqhdDa2+pDGbBo2ApxqIzvb/eNoZM5W6nDY=; b=SxwA5mJTBt03yrsu7aFXoJc95UV1+ejqJ8eegJV3Mar6mxECW62ZSydPgdTtGq3Ipr kP+mCfPeAItcTAmTflEFrEfIN/b9GReenopQ6uvzQKoyD1yFL2HxdwYIg3KJoWbozKlP wpoTGJ2A0MuZEJe0dQvNWfmcHUN7e6IEAKY16xR32NsTk2FeP//VfaH0t18u2Es3AG2a 7TTBVjdHgeM96Ylll+TTDJkKfgvKy8QpVCoiiA4BmjaXnraZC0rw0PL4EnXP17FOnnbn 6m1XXWQMMdfEgPUFYgMkfwXlsEouid2DgRwnSqVCv/u7Ojn/nEifzfm73LPz7oOrlAUR 5gfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OvNpsxNmrqhdDa2+pDGbBo2ApxqIzvb/eNoZM5W6nDY=; b=Un/3BmSqlbS78mWomWrHmz+2VJ0pJDP94PMPB7p/OBLfvghLbGMV2TAPapxZ308kvm 7M1RT3NfRlAECAFJIdqg1o2JBxJyMPjmKoaKT9K9lAC9KL6P7eQnsB8xm4UAef65/YFH iKcaaNDrfEEoAOaGLyDUgOWXmoPuGJG+cSMOok2VhLoz+cRWDt69GXbtqVwK66LFpsNE 6Pr741JHQ/8dz9WTwgjIsApjLVauD17P5+HOe3TCMFLJJ49bP5RgYEuZqeeuKm1MQP9j Cffl5QEALDrCZ1xXNGp2wuWRtZ72Y0vcqqn+1+KP9v67y892jSKr/ZDLMfMDZw5coxgN cnXQ== X-Gm-Message-State: AOAM530A7BG5UUsR80rYHNBa1b/grOWdIfPHDbQxfDUyONDTU/UYr7zX Fc0oDFexA0GOTxCaHeLEzy2IzRIgNy9wfQ== X-Google-Smtp-Source: ABdhPJw2uvi9ZGdLfOq0lsEwPHM4oal641/FwJXkkuX04gNMKRNSjSB8jUFRk0OeQuu2UAB5ZT3DTg== X-Received: by 2002:adf:a399:: with SMTP id l25mr3257668wrb.203.1622804389634; Fri, 04 Jun 2021 03:59:49 -0700 (PDT) Original-Received: from smtpclient.apple ([46.128.198.100]) by smtp.gmail.com with ESMTPSA id e17sm6969226wre.79.2021.06.04.03.59.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jun 2021 03:59:49 -0700 (PDT) In-Reply-To: <83wnr9vrpj.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.80.0.2.43) Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=p.stephani2@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:270378 Archived-At: > Am 04.06.2021 um 12:39 schrieb Eli Zaretskii : >=20 >> From: Jo=C3=A3o T=C3=A1vora >> Cc: Eli Zaretskii , Daniel Colascione = , >> emacs-devel@gnu.org, ubolonton@gmail.com >> Date: Fri, 04 Jun 2021 11:08:48 +0100 >>=20 >> - However, LSP support for fontification seems like it's potentially >> _less_ efficient than integrating something like tree-sitter as a C >> module in Emacs. That's because the contents of the buffer and >> fontification results are continually transmitted back and forth via >> pipes and JSON format. >=20 > The communication of buffer contents to these agents/servers is indeed > one aspect of the existing packages (those I had time to look at) that > I personally am unhappy about. Sending the whole buffer or its large > chunks down the wire as buffer-substring (which requires encoding to > be correct) is non-scalable, especially if it also requires conversion > to JSON. How bad is is actually; are there good numbers on this? A while ago, I tested this hypothesis by transferring the = `buffer-string' of xdisp.c to a Go module. This goes through a full = UTF-8 encoding and makes three copies (first, to create the string = object; then, to copy it to the module interface; lastly, to make a Go = string out of it), and it still only took a few milliseconds. Modern CPUs are very good at copying memory, so maybe we're optimizing = the wrong thing here. We definitely should have good benchmarks and = profiling data before deciding what to optimize.