emacs-devel
[Top][All Lists]
Advanced

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

Re: Current mode command discovery


From: Dmitry Gutov
Subject: Re: Current mode command discovery
Date: Thu, 18 Feb 2021 19:15:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 18.02.2021 16:06, Lars Ingebrigtsen wrote:
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.

All right.

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).

The difference will probably be higher in autoload files (which will require separate 'put' forms to be added, right?).

If it were up to me, I'd see if it's possible to reuse some slots in autoload byte-compiled form in a backward-compatible fashion, and then consider, depending on the actual performance difference, maybe do break it in some future version of Emacs. It's not as important as source-level compatibility, IMO.



reply via email to

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