Subject: bug#21717: 24.5; describe-variable performances

From: Thierry Volpiatto <[email-masked]>
Date: Tue, 20 Oct 2015 08:14:35 +0200

`describe-variable' can be optimized to popup faster when printing the
value of variable.

(describe-variable 'load-history)
=> describe-variable  1           52.717248403  52.717248403

Now applying following patch:

--8<---------------cut here---------------start------------->8---
@@ -763,7 +763,9 @@ it is displayed along with the global value."
 		  (if (< (+ (length print-rep) (point) (- line-beg)) 68)
 		      (insert print-rep)
 		    (terpri)
-		    (pp val)
+		    (if (listp val)
+                        (progn (insert "(") (mapc 'pp val) (insert ")"))
+                      (pp val))
 		    (if (< (point) (+ 68 (line-beginning-position 0)))
 			(delete-region from (1+ from))
 		      (delete-region (1- from) from)))
--8<---------------cut here---------------end--------------->8---

(describe-variable 'load-history)
=> describe-variable  1           1.283377719   1.283377719

PS: This is just informative in case you want to optimize it,
don't expect me to provide a fully polished fix for this.

In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, X toolkit)
 of 2015-04-12 on dell-14z
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.3 LTS

Configured using:
 `configure --with-x-toolkit=lucid --without-toolkit-scroll-bars
 --without-gconf --without-gsettings'

Important settings:
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  global-git-commit-mode: t
  recentf-mode: t
  global-git-gutter-mode: t
  git-gutter-mode: t
  eldoc-in-minibuffer-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  dired-async-mode: t
  golden-ratio-mode: t
  psession-mode: t
  helm-descbinds-mode: t
  helm-push-mark-mode: t
  eldoc-mode: t
  helm-mode: t
  shell-dirtrack-mode: t
  helm-adaptive-mode: t
  async-bytecomp-package-mode: t
  winner-mode: t
  auto-image-file-mode: t
  minibuffer-depth-indicate-mode: t
  show-paren-mode: t
  savehist-mode: t
  display-time-mode: t
  override-global-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Type "q" to restore previous buffer.
Quit
Switching to Emacs lisp indenting style.
Saving file /home/thierry/labo/emacs/lisp/help-fns.el...
Wrote /home/thierry/.emacs.d/undo-tree-history/.!home!thierry!labo!emacs!lisp!help-fns.el.~undo-tree~
Wrote /home/thierry/labo/emacs/lisp/help-fns.el
(No changes need to be saved)
C-x C-g is undefined
Quit
Mark set [2 times]

Load-path shadows:
/home/thierry/.emacs.d/elpa/emms-20150810.832/tq hides /usr/local/share/emacs/24.5/lisp/emacs-lisp/tq
~/elisp/google-maps hides ~/elisp/google-maps.el/google-maps
~/elisp/auctex/lpath hides ~/elisp/emacs-wget/lpath

Features:
(shadow emacsbug whitespace view eieio-opt cl-indent elp helm-command
linum magit-blame magit-stash magit-bisect magit-remote magit-commit
magit-sequence magit magit-apply magit-wip magit-log magit-diff
smerge-mode diff-mode magit-core magit-process magit-popup magit-mode
magit-git crm magit-section magit-utils git-commit log-edit add-log
with-editor dash helm-ls-git vc-git vc tramp-cache tramp-sh recentf
flow-fill mm-archive gnus-html url-cache mm-url gnus-cite gnus-async
gnus-bcklg qp gnus-ml nndraft nnmh nnml nnfolder parse-time epa-file
netrc gnutls network-stream starttls tls gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg nntp gnus-cache smtpmail-async mail-extr
sort tv-utils pcvs vc-cvs pcvs-parse pcvs-info pcvs-defs pcvs-util ewoc
helm-dabbrev gnus-dired nnir epa-mail helm-imenu imenu smiley gnus-art
mm-uu mml2015 mm-view mml-smime smime dig gnus-sum nnoo gnus-group
gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range
gnus-win gnus gnus-ems nnheader w3m-form mule-util addressbook-bookmark
mu4e-config config-w3m w3m-search w3m timezone w3m-hist w3m-fb
bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util
org-mu4e helm-mu mu4e-contrib mu4e mu4e-speedbar speedbar sb-image
ezimage dframe mu4e-main mu4e-view epa derived epg mu4e-headers
mu4e-compose mu4e-draft mu4e-actions ido rfc2368 smtpmail sendmail
mu4e-mark mu4e-message html2text mu4e-proc mu4e-utils doc-view
image-mode mu4e-lists mu4e-vars message rfc822 mml mml-sec mailabbrev
mail-utils gmm-utils mailheader hl-line mu4e-meta package-build
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums lisp-mnt sh-script smie executable jedi auto-complete popup
jedi-core python-environment epc ctable concurrent deferred cl
flymake-python-pyflakes flymake-easy flymake python json vc-rcs
ledger-config ledger conf-mode cc-langs cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
vc-dispatcher vc-hg jka-compr checkdoc help-mode naquadah-theme em-unix
em-term term disp-table ehelp em-script em-prompt em-ls em-hist em-pred
em-glob em-dirs em-cmpl em-basic em-banner em-alias server align-let
esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups
eshell esh-module esh-mode esh-util markdown-mode preview-latex tex-site
auto-loads slime-xref-browser tree-widget slime-banner slime-tramp
slime-asdf slime-fancy slime-trace-dialog slime-fontifying-fu
slime-package-fu slime-references slime-compiler-notes-tree
slime-scratch slime-presentations bridge slime-mdot-fu
slime-enclosing-context slime-fuzzy slime-fancy-trace
slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc
slime-repl slime-parse slime etags arc-mode archive-mode hyperspec
git-gutter ange-ftp xdvi-search eldoc-eval warnings undo-tree
dired-async migemo xmodmap pcomplete-extension pcmpl-unix pcmpl-gnu
golden-ratio psession iterator iedit iedit-lib dired-extension
org-config-thierry ob-sh org-crypt org-annotation-helper org org-macro
org-footnote org-pcomplete org-list org-faces org-entities noutline
outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs find-func cal-menu calendar cal-loaddefs init-helm-thierry
helm-descbinds helm-extensions-autoloads helm-ring helm-elisp helm-eval
edebug eldoc helm-mode helm-files rx image-dired tramp tramp-compat
tramp-loaddefs trampver shell pcomplete format-spec dired-x dired-aux
ffap thingatpt helm-buffers helm-elscreen helm-tags helm-bookmark
helm-adaptive helm-info bookmark pp helm-locate helm-grep wgrep-helm
wgrep grep helm-regexp helm-plugin helm-external helm-net browse-url xml
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse auth-source gnus-util mm-util mail-prsvr
password-cache url-vars mailcap helm-utils compile comint ansi-color
helm-help helm-types helm helm-source helm-multi-match helm-lib dired
helm-config helm-autoloads helm-easymenu cl-macs gv async-bytecomp async
helm-aliases net-utils w3m-wget advice help-fns winner ring diff
cus-edit wid-edit image-file mb-depth paren savehist edmacro kmacro time
use-package diminish bind-key easy-mmode eieio byte-opt bytecomp
byte-compile cl-extra cconv eieio-core go-mode-autoloads slime-autoloads
info easymenu package epg-config time-date avoid cus-start cus-load
cl-loaddefs cl-lib tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting font-render-setting x-toolkit x multi-tty
emacs)

Memory information:
((conses 16 731482 76450)
 (symbols 48 69449 0)
 (miscs 40 12685 1190)
 (strings 32 197064 30786)
 (string-bytes 1 5715714)
 (vectors 16 76511)
 (vector-slots 8 2018376 20080)
 (floats 8 2034 843)
 (intervals 56 9579 849)
 (buffers 960 210)
 (heap 1024 93402 5303))
-- 
Thierry
https://emacs-helm.github.io/helm/