Subject: bug#36877: 25.3; uniquify renaway uniquify-managed list

From: David Biesack <[email-masked]>
Date: Wed, 31 Jul 2019 16:04:56 +0000

The list uniquified-managed sometimes starts to grow in an unmanaged manner (I suspect exponentially) after running
Emacs for a few days. My work involves heavily editing many files named "openapi.yaml" in about 20 different
directories, often switching git branches so I need to revisit (M-x revert-buffer) these files a lot.

After a few days, I noticed opening new openapi.yaml files started to slow down dramatically - there would be several
seconds of delay, then tens of seconds. I narrowed this to uniquify. In my buffers, the local variable
uniquified-managed is more than 100,000 items long, with many duplicate items.

Here is some data (I grabbed the local variable uniquify-managed from my openapi.yaml buffer)

(length uniquify-managed)
100004

(cl-subseq uniquify-managed 0 19)
(
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/cards-api-def/src/openapi" #<buffer openapi.yaml<3>> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/acct-verifications-api-def" #<buffer openapi.yaml<acct-verifications-api-def>> "openapi.yaml<acct-verifications-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/organizations-api-def/src/openapi" #<buffer openapi.yaml> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/contacts-api-def/src/openapi" #<buffer openapi.yaml<2>> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/contacts-api-def" #<buffer openapi.yaml<contacts-api-def>> "openapi.yaml<contacts-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/transactions-api-def" #<buffer openapi.yaml<transactions-api-def>> "openapi.yaml<transactions-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/configurations-api-def" #<buffer openapi.yaml<configurations-api-def>> "openapi.yaml<configurations-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/users-api-def" #<buffer openapi.yaml<users-api-def>> "openapi.yaml</Users/david.biesack/dev/openapi/users-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/accounts-api-def/gen/openapi" #<buffer openapi.yaml<gen/openapi>> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/accounts-api-def/gen/openapi" #<buffer openapi.yaml<gen/openapi>> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/accounts-api-def/gen/openapi" #<buffer openapi.yaml<gen/openapi>> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/configurations-api-def" #<buffer openapi.yaml<configurations-api-def>> "openapi.yaml<configurations-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/users-api-def" #<buffer openapi.yaml<users-api-def>> "openapi.yaml</Users/david.biesack/dev/openapi/users-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/accounts-api-def/gen/openapi" #<buffer openapi.yaml<gen/openapi>> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/accounts-api-def/gen/openapi" #<buffer openapi.yaml<gen/openapi>> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/accounts-api-def/gen/openapi" #<buffer openapi.yaml<gen/openapi>> "openapi.yaml<openapi>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/configurations-api-def" #<buffer openapi.yaml<configurations-api-def>> "openapi.yaml<configurations-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/users-api-def" #<buffer openapi.yaml<users-api-def>> "openapi.yaml</Users/david.biesack/dev/openapi/users-api-def>"]
[cl-struct-uniquify-item "openapi.yaml" "/Users/david.biesack/dev/openapi/accounts-api-def/gen/openapi" #<buffer openapi.yaml<gen/openapi>> "openapi.yaml<openapi>"])

(mapcar (lambda (buf)
          (set-buffer buf)
          (format "uniquify-managed length is %d for buffer %s" (length uniquify-managed) (buffer-name)))
 (buffer-list))
"uniquify-managed length is 0 for buffer *scratch*"
"uniquify-managed length is 0 for buffer  *Minibuf-1*"
"uniquify-managed length is 0 for buffer *Ibuffer*"
"uniquify-managed length is 1 for buffer transient.el"
"uniquify-managed length is 1 for buffer uniquify.el.gz"
"uniquify-managed length is 100004 for buffer openapi.yaml<3>"
"uniquify-managed length is 1 for buffer emacs.el"
"uniquify-managed length is 3 for buffer schemas<dev>"
"uniquify-managed length is 1 for buffer browse-url.el.gz"
"uniquify-managed length is 0 for buffer *shell*"
"uniquify-managed length is 0 for buffer *compile-shell*"
"uniquify-managed length is 0 for buffer  SPEEDBAR"
"uniquify-managed length is 100004 for buffer openapi.yaml<acct-verifications-api-def>"
"uniquify-managed length is 5 for buffer package.json<localhost>"
"uniquify-managed length is 100004 for buffer openapi.yaml"
"uniquify-managed length is 5 for buffer package.json<organizations-api-def>"
"uniquify-managed length is 0 for buffer %1"
"uniquify-managed length is 1 for buffer .functions"
"uniquify-managed length is 1 for buffer .alias"
"uniquify-managed length is 5 for buffer package.json<starter-api-def>"
"uniquify-managed length is 5 for buffer package.json<contacts-api-def>"
"uniquify-managed length is 100004 for buffer openapi.yaml<2>"
"uniquify-managed length is 1 for buffer openapi"
"uniquify-managed length is 10 for buffer model.yaml<simpleContact>"
"uniquify-managed length is 1 for buffer README.md"
"uniquify-managed length is 1 for buffer contacts-api-def"
"uniquify-managed length is 100004 for buffer openapi.yaml<configurations-api-def>"
"uniquify-managed length is 1 for buffer accounts"
"uniquify-managed length is 100004 for buffer openapi.yaml<gen/openapi>"
"uniquify-managed length is 1 for buffer common"
"uniquify-managed length is 10 for buffer model.yaml<dev/schemas/configurations/configurationGroupSummary>"
"uniquify-managed length is 10 for buffer model.yaml<configurationGroup>"
"uniquify-managed length is 0 for buffer *Occur*"
"uniquify-managed length is 10 for buffer model.yaml<localhost:8080/schemas/configurations/configurationGroupSummary>"
"uniquify-managed length is 1 for buffer v1.0.0"
"uniquify-managed length is 1 for buffer configurationGroupSummary"
"uniquify-managed length is 2 for buffer configurations<localhost:8080>"
"uniquify-managed length is 5 for buffer package.json<cards-api-def>"
"uniquify-managed length is 1 for buffer labels.yaml"
"uniquify-managed length is 100004 for buffer openapi.yaml<transactions-api-def>"
"uniquify-managed length is 2 for buffer configurations<dev>"
"uniquify-managed length is 2 for buffer copy-schemas<david.biesack>"
"uniquify-managed length is 100004 for buffer openapi.yaml<users-api-def>"
"uniquify-managed length is 2 for buffer .gitignore<openapi-model-gen>"
"uniquify-managed length is 1 for buffer prettier.config.js"
"uniquify-managed length is 0 for buffer  *Minibuf-0*"
"uniquify-managed length is 0 for buffer *Messages*"
"uniquify-managed length is 0 for buffer  *code-conversion-work*"
"uniquify-managed length is 0 for buffer  *Echo Area 0*"
"uniquify-managed length is 0 for buffer  *Echo Area 1*"
"uniquify-managed length is 0 for buffer  *server*"
"uniquify-managed length is 0 for buffer *Diff*"
"uniquify-managed length is 0 for buffer  *code-converting-work*"
"uniquify-managed length is 0 for buffer *Compile-Log*"
"uniquify-managed length is 0 for buffer *Ediff Registry*"
"uniquify-managed length is 0 for buffer *vc*"
"uniquify-managed length is 100004 for buffer openapi.yaml<contacts-api-def>"
"uniquify-managed length is 0 for buffer *Completions*"
"uniquify-managed length is 1 for buffer filemenu"
"uniquify-managed length is 0 for buffer *Backtrace*"
"uniquify-managed length is 0 for buffer *Help*"

In GNU Emacs 25.3.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911))
 of 2017-09-12 built on builder10-9.local
Windowing system distributor 'Apple', version 10.3.1671
Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

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

Major mode: Fundamental

Minor modes in effect:
  iswitchb-mode: t
  diff-auto-refine-mode: t
  nxhtml-menu-mode: t
  nxhtml-tag-do-also: t
  popcmp-group-alternatives: t
  popcmp-short-help-beside-alts: t
  mlinks-active-links: t
  rngalt-minimal-validation-header: t
  rngalt-display-validation-header: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  midnight-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent messages:
Error during redisplay: (jit-lock-function 5001) signaled (wrong-type-argument arrayp nil)
Loading mailabbrev...done
mail-signature-file-content: Opening input file: No such file or directory, /Users/david.biesack/.signature
(New file)
Mark set [2 times]
Wrote /Users/david.biesack/.signature
Saving file /Users/david.biesack/.signature...
Mark set [2 times]
Wrote /Users/david.biesack/.signature
Kill buffer *unsent mail to [email-masked]*? (y or n) y

Load-path shadows:
/Users/david.biesack/emacs/nxhtml/web-vcs hides /Users/david.biesack/emacs/web-vcs
/Users/david.biesack/emacs/nxhtml/nxhtml-web-vcs hides /Users/david.biesack/emacs/nxhtml-web-vcs
/Users/david.biesack/emacs/bs hides /Applications/Emacs.app/Contents/Resources/lisp/bs
/Users/david.biesack/emacs/wdired hides /Applications/Emacs.app/Contents/Resources/lisp/wdired
/Users/david.biesack/emacs/autoinsert hides /Applications/Emacs.app/Contents/Resources/lisp/autoinsert
/Users/david.biesack/emacs/align hides /Applications/Emacs.app/Contents/Resources/lisp/align
/Users/david.biesack/emacs/cmuscheme hides /Applications/Emacs.app/Contents/Resources/lisp/cmuscheme
/Users/david.biesack/emacs/indent hides /Applications/Emacs.app/Contents/Resources/lisp/indent
/Users/david.biesack/emacs/whitespace hides /Applications/Emacs.app/Contents/Resources/lisp/whitespace
/Users/david.biesack/emacs/midnight hides /Applications/Emacs.app/Contents/Resources/lisp/midnight
/Users/david.biesack/emacs/xml hides /Applications/Emacs.app/Contents/Resources/lisp/xml
/Users/david.biesack/emacs/url/url-methods hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-methods
/Users/david.biesack/emacs/url/url-dav hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-dav
/Users/david.biesack/emacs/url/url-file hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-file
/Users/david.biesack/emacs/url/url-cookie hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-cookie
/Users/david.biesack/emacs/url/url-util hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-util
/Users/david.biesack/emacs/url/url-http hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-http
/Users/david.biesack/emacs/url/url-cid hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-cid
/Users/david.biesack/emacs/url/url-handlers hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-handlers
/Users/david.biesack/emacs/url/url-gw hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-gw
/Users/david.biesack/emacs/url/url-auth hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-auth
/Users/david.biesack/emacs/url/url-expand hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-expand
/Users/david.biesack/emacs/url/url-vars hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-vars
/Users/david.biesack/emacs/url/url-irc hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-irc
/Users/david.biesack/emacs/url/url-mailto hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-mailto
/Users/david.biesack/emacs/url/url-proxy hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-proxy
/Users/david.biesack/emacs/url/url-news hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-news
/Users/david.biesack/emacs/url/url-history hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-history
/Users/david.biesack/emacs/url/url-privacy hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-privacy
/Users/david.biesack/emacs/url/url-nfs hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-nfs
/Users/david.biesack/emacs/url/url-about hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-about
/Users/david.biesack/emacs/url/url-dired hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-dired
/Users/david.biesack/emacs/url/url hides /Applications/Emacs.app/Contents/Resources/lisp/url/url
/Users/david.biesack/emacs/url/url-imap hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-imap
/Users/david.biesack/emacs/url/url-cache hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-cache
/Users/david.biesack/emacs/url/url-ldap hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-ldap
/Users/david.biesack/emacs/url/url-ns hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-ns
/Users/david.biesack/emacs/url/url-ftp hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-ftp
/Users/david.biesack/emacs/url/url-misc hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-misc
/Users/david.biesack/emacs/url/url-parse hides /Applications/Emacs.app/Contents/Resources/lisp/url/url-parse
/Users/david.biesack/emacs/table hides /Applications/Emacs.app/Contents/Resources/lisp/textmodes/table
/Users/david.biesack/emacs/glasses hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/glasses
/Users/david.biesack/emacs/icon hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/icon
/Users/david.biesack/emacs/antlr-mode hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/antlr-mode
/Users/david.biesack/emacs/cpp hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/cpp
/Users/david.biesack/emacs/xscheme hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/xscheme
/Users/david.biesack/emacs/bat-mode hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/bat-mode
/Users/david.biesack/emacs/zone hides /Applications/Emacs.app/Contents/Resources/lisp/play/zone
/Users/david.biesack/emacs/solitaire hides /Applications/Emacs.app/Contents/Resources/lisp/play/solitaire
/Users/david.biesack/emacs/metamail hides /Applications/Emacs.app/Contents/Resources/lisp/mail/metamail
/Users/david.biesack/emacs/registry hides /Applications/Emacs.app/Contents/Resources/lisp/gnus/registry
/Users/david.biesack/emacs/re-builder hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/re-builder
/Users/david.biesack/emacs/elp hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/elp
/Users/david.biesack/emacs/trace hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/trace

Features:
(shadow message-mode-hooks mime-open quoted-printable qp rmail smtpmail auth-source eieio eieio-core mailto ph mail-extr emacsbug message rfc822 mml mml-sec password-cache epg mailabbrev gmm-utils mailheader debug edebug ibuf-ext ibuffer jka-compr ef vc vc-dispatcher smerge-mode rect align sh-script executable dabbrev two-column iso-transl sort filemenu json-mode json-reformat json-snatcher js cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align pcmpl-unix diff misearch multi-isearch flycheck json map subr-x dash add-hook davids-macbook-pro.local server resizing color-themes color-theme sendmail reporter color-theme-autoloads my-emacs my-keys thing gnus-dired goto-addr password-keeper-mode sensitive-mode password-generator ps-ccrypt dired-efap dired-sort-map dired-a dired-aux iswitchb msb javadecomp autobrowse last-mod highlight-indentation my-yaml speedbar sb-image ezimage dframe yaml-mode disp-table sgml-ext flymake-files flymakemsg nxhtml-autostart nxhtml-autoload majmodpri vc-git diff-mode nxhtml-menu udev-rinari udev-ecb udev flymake css-color nxhtml-mode html-quote tidy-xhtml ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff html-imenu imenu loadhist popcmp xhtml-help mlinks html-toc xml fupd html-pagetoc appmenu-fold appmenu mumamo sgml-mode edmacro kmacro ruby-mode smie rngalt rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok mumamo-cmirr cc-engine cc-vars cc-defs flyspell ispell html-upl html-site ourcomments-util cl-seq recentf tree-widget mm-url gnus gnus-ems nnheader gnus-util mail-utils org org-macro org-footnote org-pcomplete org-list org-faces org-entities 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 format-spec find-func cal-menu calendar cal-loaddefs ido bookmark apropos grep ffip gimpedit foldit noutline outline hideshow dired web-vcs derived cl-macs rx url-http tls gnutls url url-proxy url-privacy url-expand url-methods url-history mailcap url-auth url-cookie timezone url-util url-parse url-gw url-vars mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr cus-edit wid-edit compile cl web-autoload nxhtml-base easy-mmode ascii-conversion bg shell pcomplete comint ansi-color ring quickurl browse-url pp thingatpt remote-shell warnings advice paren midnight time desktop frameset cus-start cus-load finder-inf package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded 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 kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 1028590 151817)
 (symbols 48 48777 26)
 (miscs 40 98718 2882)
 (strings 32 117740 17792)
 (string-bytes 1 3962735)
 (vectors 16 66514)
 (vector-slots 8 1265641 28139)
 (floats 8 533 616)
 (intervals 56 25142 771)
 (buffers 976 87))

David Biesack | Vice President, API Platforms
[email-masked] | @davidbiesack <https://twitter.com/davidbiesack>

Disclaimer: The information in this message may be proprietary and/or confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify Apiture immediately by replying to this message and deleting it from your computer.