emacs-devel
[Top][All Lists]
Advanced

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

Re: Current mode command discovery


From: Lars Ingebrigtsen
Subject: Re: Current mode command discovery
Date: Thu, 18 Feb 2021 15:06:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 18.02.2021 12:14, Lars Ingebrigtsen wrote:
>> I guess the main performance difference is in loading the .elc files --
>> parsing and applying all the `put's.
>
> Hm. Are you saying that the use of (declare (completion ...)) form
> currently requires us to parse all .elc files?

No -- I'm saying that I guess the M-x completion performance difference
is probably very small between the two approaches.  The current approach
is to stash the data in the bytecode object and retrieving it with
`command-modes' vs. doing `get' on the symbol.  `command-modes' is O(1)
and `get' is O(n), but the n is so small on typical symbols that I doubt
there's much of a measurable difference.  And `get' has a bytecode
opcode, so it may even be faster for all I know.

But I haven't measured.

The disadvantage in using a `put' for this data is mainly in that it
makes .elc files larger (and therefore slower to load).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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