all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Correct byte compiler error/warning positions.  The solution!
@ 2021-11-26 19:56 Alan Mackenzie
  2021-11-27  5:53 ` Eli Zaretskii
  0 siblings, 1 reply; 42+ messages in thread
From: Alan Mackenzie @ 2021-11-26 19:56 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

A short while ago, I mused on a solution to the incorrect positions we
get in byte compiler warning/error messages.  My proposed solution
turned out to be impractical fantasy - it didn't and couldn't work,
because of the difficulties of getting macros to play nicely.

However, I've now hit on the answer.

My 2018 solution to the problem _was_ a solution.  It just ran somewhere
around 8% more slowly than the original it was branched from, hence was
deemed unacceptable by other hackers here.

The reason for the slowdown was the modification to the EQ macro in
lisp.h.  It became necessary to check whether "symbols with position"
were enabled whenever the first == comparison didn't match.

A _LOT_ of these comparisons were for NILP, which is just #defined as EQ
(arg, Qnil).  However if NILP were to be defined directly as arg ==
Qnil, it would bypass the overhead in EQ.  Also required here is for the
reader to handle a literal "nil" specially, and return the
non-positioned symbol `nil' for it, rather than a positioned `nil'.

I've just tried out the above on my 2018 proposed code.  On a benchmark,
the new attempt ran 7.3% faster than the 2018 version.  It thus seems
likely that this strategem will give correct positions in warning
messages without such an unacceptable slowdown.

I'm going to try it out on an up to date repository.

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2021-12-21 17:48 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-26 19:56 Correct byte compiler error/warning positions. The solution! Alan Mackenzie
2021-11-27  5:53 ` Eli Zaretskii
2021-11-27  9:31   ` Alan Mackenzie
2021-11-27 10:07     ` Eli Zaretskii
2021-11-27 10:33       ` Alan Mackenzie
2021-11-27 10:51         ` Eli Zaretskii
2021-11-27 23:05           ` Alan Mackenzie
2021-11-28  7:25             ` Eli Zaretskii
2021-11-29 11:50               ` Alan Mackenzie
2021-11-29 12:45                 ` Eli Zaretskii
2021-11-29 19:39                   ` Alan Mackenzie
2021-12-01 15:58                     ` Alan Mackenzie
2021-12-01 16:49                       ` Eli Zaretskii
2021-12-01 16:58                         ` Alan Mackenzie
2021-12-01 17:04                           ` Lars Ingebrigtsen
2021-12-01 17:21                             ` Alan Mackenzie
2021-12-01 17:38                               ` Lars Ingebrigtsen
2021-12-01 20:28                                 ` Alan Mackenzie
2021-12-01 17:08                           ` Eli Zaretskii
2021-12-01 17:12                             ` Alan Mackenzie
2021-12-01 17:53                             ` Andrea Corallo
2021-12-01 17:57                               ` Eli Zaretskii
2021-12-02 11:21                               ` Alan Mackenzie
2021-12-02 16:31                                 ` Andrea Corallo
2021-12-02 20:35                                   ` Alan Mackenzie
2021-12-03 21:05                                     ` Alan Mackenzie
2021-12-04 19:22                                       ` Andrea Corallo
2021-12-04 19:39                                         ` Eli Zaretskii
2021-12-04 19:55                                           ` Andrea Corallo
2021-12-04 19:58                                             ` Eli Zaretskii
2021-12-04 20:06                                               ` Andrea Corallo
2021-12-14 14:29                                         ` Alan Mackenzie
2021-12-15  9:33                                           ` Andrea Corallo
2021-12-17 11:54                                             ` Alan Mackenzie
2021-12-20  8:24                                               ` Andrea Corallo
2021-12-21 17:48                                                 ` Alan Mackenzie
2021-11-29 13:24                 ` Robert Pluim
2021-11-29 19:16                   ` Alan Mackenzie
2021-11-30  9:52                     ` Robert Pluim
2021-11-28 20:15             ` Andrea Corallo
2021-12-01 16:18               ` Andrea Corallo
2021-12-01 16:46                 ` Alan Mackenzie

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.