emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] emacs-26 3db388b: Speed up (format "%s" STRING) and th


From: Kaushal Modi
Subject: Re: [Emacs-diffs] emacs-26 3db388b: Speed up (format "%s" STRING) and the like
Date: Fri, 06 Oct 2017 00:47:54 +0000

On Thu, Oct 5, 2017 at 5:44 PM Paul Eggert <address@hidden> wrote:
I could not reproduce the problem, via this recipe on Fedora 26 x86-64:

   wget https://elpa.gnu.org/packages/hydra-0.14.0.tar
   tar xf hydra-0.14.0.tar
   cd hydra-0.14.0
   make clean
   make emacs="$HOME/src/gnu/emacs/emacs-tmp1/src/emacs -Q" run
   [cut and paste the code in:
http://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00160.html
   ]
   [C-x C-e after both expressions in that code]
   C-c l

where emacs-tmp1 is just after the commit in question
(3db388b0bf83d3138562f09ce25fab8ba89bcc81), built from a fresh git
checkout. I do not see the "binding stack not balanced" message.

That's indeed strange.. I cannot recreate the error if I do it *that* way. But I can recreate the error when building hydra through package.el.

Please try the below method now and see if that helps you recreate the issue:

- You just need to launch emacs -Q on the failing build, eval the whole thing below and C-c l
- Of course the code says it all, but for clarity, this will install the hydra package from GNU Elpa in your /tmp dir. So your default emacs config/elpa won't be touched.

=====
(defmacro emacs-pkg-debug-setup (pkg-alist &rest body)
  "Install packages in PKG-ALIST and evaluate BODY.
Each element of PKG-ALIST has the form (((ID . LOCATION) . (PKG1 PKG2 ..))
..).
The ID and LOCATION are the same as the ones in `package-archives'.
PKG1, PKG2, .. are package names from the ID archive.

Example usage:

1. Launch 'emacs -Q'.
2. Copy this macro definition to its scratch buffer and evaluate it.
3. Evaluate a minimum working example using this macro as below:
     (emacs-pkg-debug-setup '(;; Install hydra from GNU Elpa
                              (nil . (hydra))
                              ;; Install org from Org Elpa
                              ((\"org\" . \"http://orgmode.org/elpa/\") .
(org)))
       ;; Then evaluate the below forms
       (org-mode)) "
  (declare (indent 1) (debug t))
  `(progn
     (require 'package)
     (setq user-emacs-directory (concat temporary-file-directory
                                        (getenv "USER") "/"
                                        ".emacs.d-debug/"))
     (setq package-user-dir (format "%selpa_%s/"
                                    user-emacs-directory
                                    emacs-major-version))
     (let (archive pkgs)
       (dolist (archive-alist ,pkg-alist)
         (setq archive (car archive-alist))
         (when archive
           (add-to-list 'package-archives archive :append))
         (setq pkgs (append pkgs (cdr archive-alist))))
       (package-initialize)
       (package-refresh-contents)

       (dolist (pkg pkgs)
         (when (and pkg (not (package-installed-p pkg)))
           (package-install pkg))
         (require pkg))

       ,@body)))

(emacs-pkg-debug-setup '((nil . (hydra)))
  (defhydra hydra-test (:color teal
                        :columns 7)
    "Test Hydra"
    ("<SPC>"   (message "Pressed space") "Space")
    ("<s-SPC>" (message "Pressed super space") "Super Space")
    ("q" (message "Pressed q") "q")
    ("r" (message "Pressed r") "r")
    ("s" (message "Pressed s") "s")
    ("t" (message "Pressed t") "t")
    ("u" (message "Pressed u") "u")
    ("v" (message "Pressed v") "v")
    ("w" (message "Pressed w") "w")
    ("x" (message "Pressed x") "x")
    ("y" (message "Pressed y") "y")
    ("z" (message "Pressed z") "z")
    ("A" (message "Pressed A") "A")
    ("B" (message "Pressed B") "B")
    ("C" (message "Pressed C") "C")
    ("D" (message "Pressed D") "D")
    ("E" (message "Pressed E") "E")
    ("F" (message "Pressed F") "F")
    ("G" (message "Pressed G") "G")
    ("H" (message "Pressed H") "H")
    ("I" (message "Pressed I") "I")
    ("J" (message "Pressed J") "J")
    ("K" (message "Pressed K") "K")
    ("L" (message "Pressed L") "L")
    ("M" (message "Pressed M") "M")
    ("N" (message "Pressed N") "N")
    ("O" (message "Pressed O") "O")
    ("P" (message "Pressed P") "P")
    ("Q" (message "Pressed Q") "Q")
    ("R" (message "Pressed R") "R")
    ("S" (message "Pressed S") "S")
    ("T" (message "Pressed T") "T")
    ("U" (message "Pressed U") "U")
    ("V" (message "Pressed V") "V")
    ("W" (message "Pressed W") "W")
    ("X" (message "Pressed X") "X")
    ("Y" (message "Pressed Y") "Y")
    ("Z" (message "Pressed Z") "Z")
    ("C-g"     nil "cancel" :color blue))
  (global-set-key (kbd "C-c l") #'hydra-test/body)
  (message "Done!"))
=====
 
Can you try the same thing as the above, and if you see the problem then
let us know what .elc files you get? The .elc files I got are in the
attached tarball.

Thanks. I did ediff of my elc files vs yours and there were no differences! Probably ediff ignores byte-codes? I did not compare the two sets of files closely.

I have attached tar.xz of my .elc files. Hope that holds the key to this problem, especially the lv.elc.

I should have also sent the full error backtrace earlier.. here it is now:

Debugger entered--Lisp error: (error "binding stack not balanced (serious byte compiler bug)")
  lv-message(#("Test Hydra:\n  <SPC>: Space       <s-SPC>: Super Space       q: q                 r: r                 s: s                 t: t                 u: u\n      v: v                 w: w                 x: x                 y: y                 z: z                 A: A                 B: B\n      C: C                 D: D                 E: E                 F: F                 G: G                 H: H                 I: I\n      J: J                 K: K                 L: L                 M: M                 N: N                 O: O                 P: P\n      Q: Q                 R: R                 S: S                 T: T                 U: U                 V: V                 W: W\n      X: X                 Y: Y                 Z: Z               C-g: cancel" 14 19 (face hydra-face-teal) 33 40 (face hydra-face-teal) 60 61 (face hydra-face-teal) 81 82 (face hydra-face-teal) 102 103 (face hydra-face-teal) 123 124 (face hydra-face-teal) 144 145 (face hydra-face-teal) 155 156 (face hydra-face-teal) 176 177 (face hydra-face-teal) 197 198 (face hydra-face-teal) 218 219 (face hydra-face-teal) 239 240 (face hydra-face-teal) 260 261 (face hydra-face-teal) 281 282 (face hydra-face-teal) 292 293 (face hydra-face-teal) 313 314 (face hydra-face-teal) 334 335 (face hydra-face-teal) 355 356 (face hydra-face-teal) 376 377 (face hydra-face-teal) 397 398 (face hydra-face-teal) 418 419 (face hydra-face-teal) 429 430 (face hydra-face-teal) 450 451 (face hydra-face-teal) 471 472 (face hydra-face-teal) 492 493 (face hydra-face-teal) 513 514 (face hydra-face-teal) 534 535 (face hydra-face-teal) 555 556 (face hydra-face-teal) 566 567 (face hydra-face-teal) 587 588 (face hydra-face-teal) 608 609 (face hydra-face-teal) 629 630 (face hydra-face-teal) 650 651 (face hydra-face-teal) 671 672 (face hydra-face-teal) 692 693 (face hydra-face-teal) 703 704 (face hydra-face-teal) 724 725 (face hydra-face-teal) 745 746 (face hydra-face-teal) 764 767 (face hydra-face-teal)))
  hydra-show-hint((format #("Test Hydra:\n  <SPC>: Space       <s-SPC>: Super Space       q: q                 r: r                 s: s                 t: t                 u: u\n      v: v                 w: w                 x: x                 y: y                 z: z                 A: A                 B: B\n      C: C                 D: D                 E: E                 F: F                 G: G                 H: H                 I: I\n      J: J                 K: K                 L: L                 M: M                 N: N                 O: O                 P: P\n      Q: Q                 R: R                 S: S                 T: T                 U: U                 V: V                 W: W\n      X: X                 Y: Y                 Z: Z               C-g: cancel" 14 19 (face hydra-face-teal) 33 40 (face hydra-face-teal) 60 61 (face hydra-face-teal) 81 82 (face hydra-face-teal) 102 103 (face hydra-face-teal) 123 124 (face hydra-face-teal) 144 145 (face hydra-face-teal) 155 156 (face hydra-face-teal) 176 177 (face hydra-face-teal) 197 198 (face hydra-face-teal) 218 219 (face hydra-face-teal) 239 240 (face hydra-face-teal) 260 261 (face hydra-face-teal) 281 282 (face hydra-face-teal) 292 293 (face hydra-face-teal) 313 314 (face hydra-face-teal) 334 335 (face hydra-face-teal) 355 356 (face hydra-face-teal) 376 377 (face hydra-face-teal) 397 398 (face hydra-face-teal) 418 419 (face hydra-face-teal) 429 430 (face hydra-face-teal) 450 451 (face hydra-face-teal) 471 472 (face hydra-face-teal) 492 493 (face hydra-face-teal) 513 514 (face hydra-face-teal) 534 535 (face hydra-face-teal) 555 556 (face hydra-face-teal) 566 567 (face hydra-face-teal) 587 588 (face hydra-face-teal) 608 609 (face hydra-face-teal) 629 630 (face hydra-face-teal) 650 651 (face hydra-face-teal) 671 672 (face hydra-face-teal) 692 693 (face hydra-face-teal) 703 704 (face hydra-face-teal) 724 725 (face hydra-face-teal) 745 746 (face hydra-face-teal) 764 767 (face hydra-face-teal))) hydra-test)
  hydra-test/body()
  funcall-interactively(hydra-test/body)
  call-interactively(hydra-test/body nil nil)
  command-execute(hydra-test/body)

   
What platform are you using?

OS: RHEL 6.6

Here is my detailed emacs version info (I just rebuilt using the failing commit 3db388b0 directly):

Emacs version: GNU Emacs 26.0.60 (build 19, x86_64-pc-linux-gnu, GTK+ Version 2.24.23)
 of 2017-10-05, built using commit 3db388b0bf83d3138562f09ce25fab8ba89bcc81.

./configure options:
  --with-modules --prefix=/home/kmodi/usr_local/apps/6/emacs/3db388_format_speedup '--program-transform-name=s/^ctags$/ctags_emacs/' 'CPPFLAGS=-I/home/kmodi/usr_local/6/include -I/usr/include/freetype2 -I/usr/include' 'CFLAGS=-ggdb3 -O0' 'CXXFLAGS=-ggdb3 -O0' 'LDFLAGS=-L/home/kmodi/usr_local/6/lib -L/home/kmodi/usr_local/6/lib64 -ggdb3'

Features:
  XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 MODULES

Thanks.

PS: If the above emacs-pkg-debug-setup helps out, it will be great if it can be included in emacs (so that I don't need to paste the whole macro each time :P)
--

Kaushal Modi

Attachment: hydra-built-using-package-emacs-26.tar.xz
Description: Binary data


reply via email to

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