[Top][All Lists]

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

Re: cc-mode fontification feels random

From: Philipp
Subject: Re: cc-mode fontification feels random
Date: Fri, 4 Jun 2021 12:59:45 +0200

> Am 04.06.2021 um 12:39 schrieb Eli Zaretskii <eliz@gnu.org>:
>> From: João Távora <joaotavora@gmail.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  Daniel Colascione <dancol@dancol.org>,
>>  emacs-devel@gnu.org,  ubolonton@gmail.com
>> Date: Fri, 04 Jun 2021 11:08:48 +0100
>> - 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.
> 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.

reply via email to

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