unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70108: 29.1.90; `defalias' and `current-load-list'
@ 2024-03-31 15:34 Mickey Petersen
  2024-03-31 15:46 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Mickey Petersen @ 2024-03-31 15:34 UTC (permalink / raw)
  To: 70108

Here's a curious one. This is not so much a bug, I think, as a gotcha
and perhaps something that I wouldn't mind understanding a bit better.

My package creates a number of dynamic commands (think:
tempo/skeletons) to expand text.

It does so using the common (defalias NAME (lambda () ...)) pattern.

This obviously goes into the C core where a bunch of stuff takes
place. One of variables that gets updated (somehow) is
`current-load-list'. Curiously, it ends up with duplicate entries. I'm
presuming there is a good reason for this.

This variable can easily get overrun with identical entries if the
inattentive programmer does not check if it is already bound.

Due to a screwup on my part, I did not `fboundp' check first, which had the
odd effect of causing incredible slowdowns when I ran my 600+ ERT test
suite.

I have not narrowed down exactly *why* my ERT suite, when beset by 600
tests to run in one go, causes the slowdown. What I'm guessing from
how each successive tests slows down, that there is some sort of
non-linear searching going on here, and either `load' (and friends) or
the mere fact that putting more defaliases into the system causes this
slowdown to occur.

Anyway. Not sure it's a bug; but it caught me out, and as
`current-load-list' is rather obscure, I figured I'd at least ask.

Thanks!

Mickey.





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

end of thread, other threads:[~2024-04-01 16:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-31 15:34 bug#70108: 29.1.90; `defalias' and `current-load-list' Mickey Petersen
2024-03-31 15:46 ` Eli Zaretskii
2024-04-01 14:58   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-01 15:34     ` Mickey Petersen
2024-04-01 16:40       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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