emacs-devel
[Top][All Lists]
Advanced

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

Re: What is the most useful potential feature which Emacs lacks? A: Auto


From: Dmitry Gutov
Subject: Re: What is the most useful potential feature which Emacs lacks? A: Autocompletion
Date: Wed, 3 Jun 2020 21:49:26 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

On 03.06.2020 17:40, Konstantin Kharlamov wrote:

I mean, I was typing outside Emacs, in the same terminal where
`libinput debug-events` was running. I was just testing how fast I can
type, to figure out how small the timeout should be set if I want a
completion to pop up.

Not sure how to interpret its output. Here's what I was getting while typing 'prog':

 event15  KEYBOARD_KEY     +21.57s      *** (-1) pressed
 event15  KEYBOARD_KEY     +21.66s      *** (-1) pressed
 event15  KEYBOARD_KEY     +21.68s      *** (-1) released
 event15  KEYBOARD_KEY     +21.74s      *** (-1) pressed
 event15  KEYBOARD_KEY     +21.76s      *** (-1) released
 event15  KEYBOARD_KEY     +21.84s      *** (-1) pressed
 event15  KEYBOARD_KEY     +21.86s      *** (-1) released
 event15  KEYBOARD_KEY     +22.00s      *** (-1) released

That seems like I hit a key per ~100ms, but handling the releases adds its latency.

I don't see any lags, so I assume using an async backend with the
timeout set to 0 should work fine.

Indeed, that's what asynchronous means. But the quality of the user
experience also depends on how quickly the backing server can handle
those requests.

Well, I paused the backing server in the steps above, so server
couldn't answer. This was emulating a behaviour where a user works with
a project too big for backend to return a completion immediately.

That tests the best case (which is, it assumes that when you turn the server back, it can handle the load). No typing latency is good (of course), but if you don't see completion suggestions because the backing process is overloaded, that's not so great either.

I'm not saying it's going to be a problem with Irony or LSP necessarily, but I've seen this reported in other circumstances. Just something to pay attention to.

The majority of backends are synchronous. And the "standard"
completion
API for Emacs (which we want to integrate with) still only supports
the
synchronous convention.

I am a bit confused by the last sentence. What's the relation between
the Emacs API and already working company-mode? Did you mean, company-
mode is trying to be compatible with backends for some standard Emacs
API, and those can't be async?

Pretty much.

Eglot does include a hack to minimize typing latency as well, but it's an ad-hoc solution, and there's no way Company would be able to detect this kind of approach being used.



reply via email to

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