unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Renaming eglot -- or at least add an alias?
Date: Fri, 14 Oct 2022 09:25:00 +1100	[thread overview]
Message-ID: <86ilknco4a.fsf@gmail.com> (raw)
In-Reply-To: <86bkqgdnz6.fsf@stephe-leake.org>


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Theodor Thornhill <theo@thornhill.no> writes:
>
>> On 13 October 2022 02:47:51 CEST, Stephen Leake <stephen_leake@stephe-leake.org> wrote:
>>>Richard Stallman <rms@gnu.org> writes:
>>>
>>>> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
>>>> [[[ whether defending the US Constitution against all enemies,     ]]]
>>>> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>>>>
>>>>   > > Because all of the interaction between server and client in lsp is json
>>>>   > > there's a huge overhead with parsing and shipping things into the emacs
>>>>   > > user interface.  So IMO what tree-sitter is good at should be left to
>>>>   > > tree-sitter.
>>>
>>>Premature optimization.
>>>
>>
>> Why do you say that? 
>
> Because it gives a supposed cause without evidence of an actual problem.
>
>> I've been using lsp for a long time, and typing lag can get unbearable
>> with servers that sends too much stuff. When 20k completions
>> containing _full_ documentation for every result that json gets
>> humongous. 
>
> Ok, that's actual data. On the other hand, did you measure different
> parts of the process, so you are sure that the json is the bottleneck,
> and not something else? It's not clear just from this description that a
> tree-sitter implementation would be faster.
>
> In addition, LSP supports sending the documentation later, after the user
> has actually looked at a completion item, using a completionItem/resolve
> request. So this sounds like a specific client or server implementation
> problem more than an inherent LSP problem.
>
>> Adding syntax highlights on top of that isn't advisable, considering
>> emacs nonmultithreaded nature.
>
> Syntax highlighting, mediated by font-lock, should only ever send small
> amounts of data; one screen full at a time. That is if the server
> supports the textDocument/semanticTokens/range request, and not just the
> textDocument/semanticTokens/full request.

I think I agree. I've often seen the criticism that LSP based solutions
are no good because of poor performance arising from the use of JSON as
the communication format. 

As someone who has done his share of web development and is very
familiar with the pros and cons of JSON and alternative formats which (I
think) are far superior, I can udnerstand where this concern can come
from. 

However, having used LSP based setups (lsp-mode and eglot) fro quite
some time on some large projects with many files and some large source
files and in a couple of different languages, I have to say I've not
noticed performance issues at all. I have run into other issues, most of
which have been resolved. I did find with eglot that it was important
to ensure the packages it users were up-to-date (i.e. xref, flymake,
eldoc etc). 

What I have observed is that unsurprisingly, results are very dependent
on the language server you are using. For example, I switched the LSP
server I was using for Javascript and immediately experienced a much
better result. Actually, this was one of the nice aspects of using an
LSP based work flow. Changeing LSP server was a simple as downloading
the server executable and changing one variable in my client config. 

I have not used LSP for font locking, but have used it for indentation
and it worked fine with no observable performance issues like typing lag
etc.

The other aspect of using LSP which I've found interesting, but really
only as something to hack/playh with, has been setting up your own LSP
server for a specific language. I experimented using Clojure and Raku
and was surprised how quickly/easily you could add functionality to my
editor, primarily as I was able to leverage of built-in functionality
of the languages I was working with. I think this ability to leverage of
the target languages built-in features combined with a smaller code base
and reduced maintenance within the editor core is what gives the LSP
architecture an edge over solutions like tree-sitter. The fact it can be
used with multiple different editors is the sugar on top.

However, if the effort has been done to add tree-sitter support for a
language and it is maintained, then it will likely to perform better in
many cases and could well be the preferred choice for many users.



  parent reply	other threads:[~2022-10-13 22:25 UTC|newest]

Thread overview: 199+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30  8:04 Renaming eglot -- or at least add an alias? Stefan Kangas
2022-09-30  8:27 ` Philip Kaludercic
2022-09-30  8:59   ` Theodor Thornhill
2022-09-30 12:30     ` Rudolf Adamkovič
2022-09-30 11:33   ` Basil L. Contovounesios
2022-09-30 11:38     ` João Távora
2022-09-30 12:18       ` Basil L. Contovounesios
2022-09-30 12:24         ` João Távora
2022-10-02  1:09         ` Richard Stallman
2022-09-30 13:26     ` Robert Pluim
2022-09-30 16:21       ` Basil L. Contovounesios
2022-09-30 10:30 ` Eli Zaretskii
2022-10-01  9:28   ` Richard Stallman
2022-10-01  9:53     ` Eli Zaretskii
2022-10-01 15:33       ` Philip Kaludercic
2022-10-01 15:39         ` Eli Zaretskii
2022-10-03  1:06           ` Richard Stallman
2022-10-03 16:28             ` Eli Zaretskii
2022-10-01 14:51     ` Stefan Monnier
2022-10-01 18:16       ` Stefan Monnier
2022-10-02  1:11       ` Richard Stallman
2022-10-02  1:31         ` Tim Cross
2022-10-02  2:45           ` Yilkal Argaw
2022-10-02 11:34           ` Philip Kaludercic
2022-10-02 12:44             ` João Távora
2022-10-02 14:05               ` Philip Kaludercic
2022-10-02 14:42                 ` João Távora
2022-10-02 15:03                   ` Manuel Uberti
2022-10-02 15:08                     ` Lars Ingebrigtsen
2022-10-12 11:32                       ` Robert Weiner
2022-10-12 11:55                         ` Po Lu
2022-10-12 13:25                           ` Eli Zaretskii
2022-10-12 13:42                             ` Po Lu
2022-10-12 14:03                               ` Eli Zaretskii
2022-10-02 19:54                     ` Jose A. Ortega Ruiz
2022-10-02 22:17                       ` Tim Cross
2022-10-04  1:00                       ` Richard Stallman
2022-10-02 15:52                   ` Philip Kaludercic
2022-10-02 20:07                     ` João Távora
2022-10-03 11:21                       ` Philip Kaludercic
2022-10-02 21:30                 ` Tim Cross
2022-10-03 11:06                   ` Philip Kaludercic
2022-10-03 12:34                     ` João Távora
2022-10-03 13:18                       ` Stefan Monnier
2022-10-03 16:35                         ` João Távora
2022-10-03 17:06                           ` Stefan Monnier
2022-10-04  1:01             ` Richard Stallman
2022-10-04  7:02               ` Philip Kaludercic
2022-10-04 11:27                 ` Tim Cross
2022-10-06 10:24             ` Philip Kaludercic
2022-10-06 14:11               ` [External] : " Drew Adams
2022-10-06 22:09               ` Dmitry Gutov
2022-10-01 21:57     ` Tim Cross
2022-10-03  1:07       ` Richard Stallman
2022-10-03  1:13         ` Tim Cross
2022-10-04  1:01           ` Richard Stallman
2022-10-04  1:01           ` Richard Stallman
2022-10-04  2:43             ` Po Lu
2022-10-04  7:06             ` Eli Zaretskii
2022-10-04 17:39               ` Richard Stallman
2022-10-04 18:12                 ` Eli Zaretskii
2022-10-05 21:35                   ` Richard Stallman
2022-10-05 23:21                     ` Dmitry Gutov
2022-10-07 22:49                       ` Richard Stallman
2022-10-06  0:13                     ` Tim Cross
2022-10-06  0:38                       ` Po Lu
2022-10-06  1:18                         ` Tim Cross
2022-10-06  6:17                       ` Eli Zaretskii
2022-10-07 22:50                       ` Richard Stallman
2022-10-07 22:50                       ` Richard Stallman
2022-10-08 18:18                         ` chad
2022-10-09  0:35                           ` Po Lu
2022-10-09 14:21                             ` chad
2022-10-06  0:13                     ` Tim Cross
2022-10-06  0:36                     ` Po Lu
2022-10-06  5:57                     ` Eli Zaretskii
2022-10-07 22:49                   ` Richard Stallman
2022-10-07 23:20                     ` Dmitry Gutov
2022-10-04 22:01                 ` Tim Cross
2022-10-05 10:57                   ` Alfred M. Szmidt
2022-10-05 13:17                     ` Eli Zaretskii
2022-10-05 14:46                       ` Alfred M. Szmidt
2022-10-05 15:55                         ` Alexander Adolf
2022-10-06 22:06                         ` Richard Stallman
2022-10-06 22:08                       ` Richard Stallman
2022-10-06 22:30                         ` Tim Cross
2022-10-06 23:42                           ` Jose A. Ortega Ruiz
2022-10-07 22:49                   ` Richard Stallman
2022-10-05  3:01                 ` Po Lu
2022-10-07 22:48                   ` Richard Stallman
2022-10-05 10:43             ` Alfred M. Szmidt
2022-10-06 22:09               ` Richard Stallman
2022-10-07  6:34                 ` Eli Zaretskii
2022-10-07 10:12                   ` Dmitry Gutov
2022-10-07 11:27                     ` Eli Zaretskii
2022-10-07 11:38                       ` Dmitry Gutov
2022-10-07 11:48                         ` Eli Zaretskii
2022-10-07 12:03                           ` Dmitry Gutov
2022-10-07 12:09                             ` Eli Zaretskii
2022-10-07 12:34                               ` Dmitry Gutov
2022-10-07 15:03                                 ` Emanuel Berg
2022-10-07 22:03                                   ` Tim Cross
2022-10-08  5:32                                     ` tomas
2022-10-08  6:52                                       ` Eli Zaretskii
2022-10-08  7:20                                         ` tomas
2022-10-08 16:10                                       ` [External] : " Drew Adams
2022-10-08 22:17                                 ` Alexander Adolf
2022-10-09  3:32                                   ` Stefan Monnier
2022-10-11 21:15                                     ` Richard Stallman
2022-10-11 21:54                                       ` Stefan Monnier
2022-10-12 13:21                                         ` Alexander Adolf
2022-10-12 22:02                                         ` Richard Stallman
2022-10-08 22:34                               ` Richard Stallman
2022-10-09  4:38                                 ` Eli Zaretskii
2022-10-09  4:57                                   ` Eli Zaretskii
2022-10-09  6:07                                     ` Theodor Thornhill
2022-10-09  7:56                                     ` Tim Cross
2022-10-10 22:03                                       ` Richard Stallman
2022-10-09 12:44                                     ` Dmitry Gutov
2022-10-09 13:30                                       ` Eli Zaretskii
2022-10-09 14:09                                       ` Felician Nemeth
2022-10-09 14:15                                         ` Dmitry Gutov
2022-10-09 14:45                                           ` Felician Nemeth
2022-10-09 15:25                                             ` Dmitry Gutov
2022-10-14  9:55                                               ` João Távora
2022-10-11 21:15                                     ` Richard Stallman
2022-10-12  6:04                                       ` Eli Zaretskii
2022-10-12  6:37                                         ` Yuan Fu
2022-10-12  7:15                                           ` Eli Zaretskii
2022-10-12  9:24                                             ` Tim Cross
2022-10-12 23:19                                               ` Yuan Fu
2022-10-13  0:17                                                 ` Tim Cross
2022-10-13  0:26                                                 ` Stephen Leake
2022-10-12 23:05                                             ` Yuan Fu
2022-10-12 10:50                                           ` Dmitry Gutov
2022-10-12 22:58                                             ` Yuan Fu
2022-10-14  9:59                                             ` João Távora
2022-10-13  0:41                                           ` Stephen Leake
2022-10-13  6:03                                             ` Stephen Leake
2022-10-12 13:34                                       ` Michael Albinus
2022-10-10 22:05                                   ` Richard Stallman
2022-10-11  9:24                                     ` Eli Zaretskii
2022-10-11  9:44                                       ` Theodor Thornhill
2022-10-11 17:19                                         ` Dmitry Gutov
2022-10-12 22:01                                           ` Richard Stallman
2022-10-13  0:47                                             ` Stephen Leake
2022-10-13  6:59                                               ` Theodor Thornhill
2022-10-13  8:59                                                 ` Philip Kaludercic
2022-10-13 10:37                                                   ` Eli Zaretskii
2022-10-13 10:20                                                 ` Stephen Leake
2022-10-13 10:35                                                   ` Dmitry Gutov
2022-10-13 16:11                                                   ` Theodor Thornhill
2022-10-14  3:56                                                     ` Akib Azmain Turja
2022-10-13 22:25                                                   ` Tim Cross [this message]
2022-10-03  1:55         ` Po Lu
2022-10-03  3:28           ` Tim Cross
2022-10-03 16:30         ` Eli Zaretskii
2022-10-04  1:02           ` Richard Stallman
2022-10-04  7:00             ` Eli Zaretskii
2022-10-04 17:39               ` Richard Stallman
2022-10-04 18:05                 ` Eli Zaretskii
2022-10-07 22:50                   ` Richard Stallman
2022-10-08  6:42                     ` Eli Zaretskii
2022-10-14  9:45                       ` João Távora
2022-10-03 19:57         ` Rudolf Adamkovič
2022-10-04  1:03           ` Richard Stallman
2022-10-04  1:40             ` Yuri Khan
2022-09-30 10:31 ` Po Lu
2022-09-30 10:52   ` Eglot manual (Was: Renaming eglot -- or at least add an alias?) João Távora
2022-09-30 10:32 ` Renaming eglot -- or at least add an alias? João Távora
2022-09-30 10:46 ` Daniel Martín
2022-09-30 10:50   ` Daniel Martín
2022-09-30 13:19     ` Po Lu
2022-09-30 13:18   ` Po Lu
2022-09-30 13:15 ` Lars Ingebrigtsen
2022-09-30 14:48   ` [External] : " Drew Adams
2022-10-02  7:21 ` Christopher M. Miles
     [not found] ` <m28rlywurw.fsf@numbchild>
2022-10-04  2:08   ` Christopher M. Miles
     [not found]   ` <m28rlwjpx3.fsf@numbchild@gmail.com>
2022-10-04  5:25     ` Akib Azmain Turja
2022-10-04 17:39       ` Richard Stallman
2022-10-04 21:30         ` Tim Cross
2022-10-04 22:06           ` Philip Kaludercic
2022-10-04 22:31             ` Tim Cross
2022-10-05 23:25               ` Dmitry Gutov
2022-10-07 22:47             ` Richard Stallman
2022-10-05  2:59           ` Po Lu
2022-10-05  8:41         ` Simon Leinen
2022-10-05 13:21           ` Gerd Möllmann
2022-10-05 10:09         ` Akib Azmain Turja
2022-10-04  5:25 ` Gerd Möllmann
2022-10-04  7:43   ` Eli Zaretskii
2022-10-04  8:54     ` Gerd Möllmann
2022-10-04  9:57     ` João Távora
2022-10-04 11:15       ` Gerd Möllmann
2022-10-04 15:19   ` [External] : " Drew Adams
2022-10-06 23:29 ` Stefan Kangas
  -- strict thread matches above, loose matches on Subject: below --
2022-09-30  8:54 Payas Relekar
2022-10-04 10:10 xenodasein--- via Emacs development discussions.
2022-10-08  9:33 xenodasein--- via Emacs development discussions.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ilknco4a.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).