Subject: bug#13366: 24.3.50; emacs 24 slow-down

From: Stefan Monnier <[email-masked]>
Date: Sun, 03 Feb 2013 10:30:19 -0500

> I've been   noticing sporadic but painful slow-downs in emacs 24
> tip-of-tree -- but it's hard to pin down.

I've installed the patch below, which should help.

        Stefan

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2013-02-02 08:41:02 +0000
+++ lisp/ChangeLog	2013-02-03 15:28:10 +0000
@@ -1,3 +1,8 @@
+2013-02-03  Stefan Monnier  <[email-masked]>
+
+	* subr.el (internal--called-interactively-p--get-frame): Avoid filling
+	current-load-list (bug#13366).
+
 2013-02-02  Christopher Schmidt  <[email-masked]>
 
 	* progmodes/compile.el (compilation-error-regexp-alist-alist):

=== modified file 'lisp/subr.el'
--- lisp/subr.el	2013-01-13 01:23:48 +0000
+++ lisp/subr.el	2013-02-03 15:25:47 +0000
@@ -3976,12 +3976,14 @@
   ;; "static" variables.
   (let ((sym (make-symbol "base-index")))
     `(progn
-       (defvar ,sym
+       (defvar ,sym)
+       (unless (boundp ',sym)
          (let ((i 1))
+           (message "Computing base-index")
            (while (not (eq (indirect-function (nth 1 (backtrace-frame i)) t)
                            (indirect-function 'called-interactively-p)))
              (setq i (1+ i)))
-           i))
+           (setq ,sym i)))
        ;; (unless (eq (nth 1 (backtrace-frame ,sym)) 'called-interactively-p)
        ;;   (error "called-interactively-p: %s is out-of-sync!" ,sym))
        (backtrace-frame (+ ,sym ,n)))))