emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: William Denton <william@williamdenton.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Bruno Cardoso <cardoso.bc@gmail.com>,
	Emacs Org mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Things got very slow: profiler output
Date: Sat, 16 Mar 2024 18:39:16 +0000	[thread overview]
Message-ID: <Thw2P_bFDxJukQTh_Fg125jTlrb4zmciJVc-5xswHWAgORE_DaK-ej0d2Yhi88VLJ0y5-i6IapzOx3fB2l5mrJ1CsbEmCRXA2Dtab6gQnG8=@williamdenton.org> (raw)
In-Reply-To: <875xxmi30r.fsf@localhost>

On Saturday, March 16th, 2024 at 11:56, Ihor Radchenko <yantar92@posteo.net> wrote:

> > > What if you try the following version of `org-activate-folds'?
> > > ...
> > 
> > It makes almost no difference.
> 
> Ok.
> Then, what about the latest main?

I tried it, and I'm sorry to say all the same problems keep happening.  

I tried the test you mentioned here:

https://lists.gnu.org/archive/html/emacs-orgmode/2024-03/msg00362.html

I loaded up my big Org file and moved around a while.  I got:

Function Name                              Call Count  Elapsed Time  Average Time
org-fold-core--property-symbol-get-create  33325       0.0058796690  1.764...e-07

I don't know if that's helpful.

For me all this is triggered by my work-diary.org file, which has fair bit of fontification in it: headings, 1200 clock entries, links, and so on.  It had a big clockable at the bottom, which gave me the "Stack overflow in regexp matcher" I mentioned last month:

https://lists.gnu.org/archive/html/emacs-orgmode/2024-02/msg00347.html

I moved the clocktable to another file and the error stopped.  But now it's back.  I've been adding to work-diary.org in the meantime, so perhaps the problem was triggered by going over some limit, and I got it down under that limit, but now it's back over.  Bruno's problem is triggered by a large file---but surely many people here have large files in Org, so why aren't they seeing this?  Frustrating.

I turned on debugging and will the regex overflow stack trace below in case it's helpful.  (This is beyond my debugging skills, so I'm just pasting in anything I've got now.)

To be clear:  all these problems happen when I use the latest Org development source.  Using the Org in the current Emacs development tree (I'm on 30.0.50), there's no problem.  The Emacs source doesn't have the commit I identified earlier as being where my problems started.  I'm toggling between versions by commenting this on or off:

(use-package org
    ;; :pin manual
    ;; :load-path "/usr/local/src/org-mode/lisp"

Ihor and Bruno, might it help if we did a video call and shared screens to see problems live?  My Lisp is limited but I'll help how I can.


Thanks,

Bill
--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada

 Debugger entered--Lisp error: (error "Stack overflow in regexp matcher")
  re-search-forward("^[ \11]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)\\(?:.\\|\n\\)+?\\\\end{\\2}\\)\\|\\([^$]\\|^\\)\\(\\$[^ \11\15\n,;.$]\\$\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|'\\|$\\)\\|\\([^$]\\|^\\)\\(\\(\\$\\([^ \11\n,;.$][^$\n\15]*?\\(\n[^$\n\15]*?\\)\\{0,2\\}[^ \11\n,.$]\\)\\$\\)\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|'\\|$\\)\\|\\\\(\\(?:.\\|\n\\)*?\\\\)\\|\\\\\\[\\(?:.\\|\n\\)*?\\\\\\]\\|\\$\\$\\(?:.\\|\n\\)*?\\$\\$" nil t)
  org-do-latex-and-related(#<marker at 770 in work-diary.org>)
  font-lock-fontify-keywords-region(522 #<marker at 770 in work-diary.org> nil)
  font-lock-default-fontify-region(522 #<marker at 770 in work-diary.org> nil)
  font-lock-fontify-region(522 #<marker at 770 in work-diary.org>)
  #f(compiled-function (beg end) #<bytecode -0x356cca3983ed8d0>)(522 #<marker at 770 in work-diary.org>)
  font-lock-ensure(522 #<marker at 770 in work-diary.org>)
  org-table-align()
  org-table-map-tables(org-table-align t)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode--apply-alist((("\\.yml$" . yaml-mode) ("\\.\\(r\\(?:ng\\|ss\\)\\|s\\(?:ch\\|vg\\)\\|x\\(?:ml\\|s\\(?:d\\|lt\\)\\)\\)\\'" . nxml-mode) ("\\.[pP][dD][fF]\\'" . pdf-view-mode) ("README\\.md\\'" . gfm-mode) ("\\(?:\\(?:\\.\\(?:b\\(?:\\(?:abel\\|ower\\)rc\\)\\|json\\(?:ld\\)?\\)\\|composer\\.lock\\)\\'\\)" . json-mode) ("\\.hva\\'" . LaTeX-mode) ("\\.tsv\\'" . tsv-mode) ("\\.[Cc][Ss][Vv]\\'" . csv-mode) ("\\.[Ss][Aa][Ss]\\'" . SAS-mode) ("\\.Sout\\'" . S-transcript-mode) ("\\.[Ss]t\\'" . S-transcript-mode) ("\\.Rd\\'" . Rd-mode) ("DESCRIPTION\\'" . conf-colon-mode) ("/Makevars\\(\\.win\\)?\\'" . makefile-mode) ("\\.[Rr]out\\'" . ess-r-transcript-mode) ("CITATION\\'" . ess-r-mode) ("NAMESPACE\\'" . ess-r-mode) ("\\.[rR]profile\\'" . ess-r-mode) ("\\.[rR]\\'" . ess-r-mode) ("/R/.*\\.q\\'" . ess-r-mode) ("\\.[Jj][Aa][Gg]\\'" . ess-jags-mode) ("\\.[Bb][Mm][Dd]\\'" . ess-bugs-mode) ("\\.[Bb][Oo][Gg]\\'" . ess-bugs-mode) ("\\.[Bb][Uu][Gg]\\'" . ess-bugs-mode) ("/git-rebase-todo\\'" . git-rebase-mode) ("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode) ("\\.\\(e?ya?\\|ra\\)ml\\'" . yaml-mode) ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr) ("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil jka-compr) ("\\.Z\\'" nil jka-compr) ("\\.vr[hi]?\\'" . vera-mode) ("\\(?:\\.\\(?:rbw?\\|ru\\|rake\\|thor\\|axlsx\\|jbuilder\\|rabl\\|gemspec\\|podspec\\)\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Puppet\\|Berks\\|Brew\\|Fast\\|Vagrant\\|Guard\\|Pod\\)file\\)\\'" . ruby-mode) ("\\.re?st\\'" . rst-mode) ("/\\(?:Pipfile\\|\\.?flake8\\)\\'" . conf-mode) ("\\.py[iw]?\\'" . python-mode) ("\\.m\\'" . octave-maybe-mode) ("\\.less\\'" . less-css-mode) ("\\.scss\\'" . scss-mode) ("\\.cs\\'" . csharp-mode) ("\\.awk\\'" . awk-mode) ("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode) ("\\.idl\\'" . idl-mode) ("\\.java\\'" . java-mode) ...) nil nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer work-diary.org> "~/york/shared/work-diaries/work-diary.org" nil nil "~/york/shared/work-diaries/work-diary-2023-2024.org" (10223630 66310))
  find-file-noselect("/home/wdenton/york/shared/work-diaries/work-diary.org")
  org-clock-load()
  run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook)
  apply(run-hooks change-major-mode-after-body-hook (text-mode-hook outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode--apply-alist((("\\.yml$" . yaml-mode) ("\\.\\(r\\(?:ng\\|ss\\)\\|s\\(?:ch\\|vg\\)\\|x\\(?:ml\\|s\\(?:d\\|lt\\)\\)\\)\\'" . nxml-mode) ("\\.[pP][dD][fF]\\'" . pdf-view-mode) ("README\\.md\\'" . gfm-mode) ("\\(?:\\(?:\\.\\(?:b\\(?:\\(?:abel\\|ower\\)rc\\)\\|json\\(?:ld\\)?\\)\\|composer\\.lock\\)\\'\\)" . json-mode) ("\\.hva\\'" . LaTeX-mode) ("\\.tsv\\'" . tsv-mode) ("\\.[Cc][Ss][Vv]\\'" . csv-mode) ("\\.[Ss][Aa][Ss]\\'" . SAS-mode) ("\\.Sout\\'" . S-transcript-mode) ("\\.[Ss]t\\'" . S-transcript-mode) ("\\.Rd\\'" . Rd-mode) ("DESCRIPTION\\'" . conf-colon-mode) ("/Makevars\\(\\.win\\)?\\'" . makefile-mode) ("\\.[Rr]out\\'" . ess-r-transcript-mode) ("CITATION\\'" . ess-r-mode) ("NAMESPACE\\'" . ess-r-mode) ("\\.[rR]profile\\'" . ess-r-mode) ("\\.[rR]\\'" . ess-r-mode) ("/R/.*\\.q\\'" . ess-r-mode) ("\\.[Jj][Aa][Gg]\\'" . ess-jags-mode) ("\\.[Bb][Mm][Dd]\\'" . ess-bugs-mode) ("\\.[Bb][Oo][Gg]\\'" . ess-bugs-mode) ("\\.[Bb][Uu][Gg]\\'" . ess-bugs-mode) ("/git-rebase-todo\\'" . git-rebase-mode) ("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode) ("\\.\\(e?ya?\\|ra\\)ml\\'" . yaml-mode) ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr) ("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil jka-compr) ("\\.Z\\'" nil jka-compr) ("\\.vr[hi]?\\'" . vera-mode) ("\\(?:\\.\\(?:rbw?\\|ru\\|rake\\|thor\\|axlsx\\|jbuilder\\|rabl\\|gemspec\\|podspec\\)\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Puppet\\|Berks\\|Brew\\|Fast\\|Vagrant\\|Guard\\|Pod\\)file\\)\\'" . ruby-mode) ("\\.re?st\\'" . rst-mode) ("/\\(?:Pipfile\\|\\.?flake8\\)\\'" . conf-mode) ("\\.py[iw]?\\'" . python-mode) ("\\.m\\'" . octave-maybe-mode) ("\\.less\\'" . less-css-mode) ("\\.scss\\'" . scss-mode) ("\\.cs\\'" . csharp-mode) ("\\.awk\\'" . awk-mode) ("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode) ("\\.idl\\'" . idl-mode) ("\\.java\\'" . java-mode) ...) nil nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil nil)
  find-file-noselect-1(#<buffer init.org> "~/.emacs.d/init.org" :nowarn nil "~/.emacs.d/init.org" (9704630 66310))
  find-file-noselect("/home/wdenton/.emacs.d/init.org" :nowarn)
  desktop-restore-file-buffer("/home/wdenton/.emacs.d/init.org" "init.org" nil)
  desktop-create-buffer(208 "/home/wdenton/.emacs.d/init.org" "init.org" org-mode (font-lock-mode visual-line-mode prettify-symbols-mode corfu-mode anzu-mode yas-minor-mode undo-tree-mode git-gutter-mode wrap-region-mode flyspell-mode org-appear-mode org-superstar-mode mixed-pitch-mode org-indent-mode) 3969 (nil nil) nil nil ((tab-width . 8) (indent-tabs-mode) (buffer-display-time 26101 53586 2647 436000) (buffer-file-coding-system . utf-8-unix) (truncate-lines)) ((mark-ring nil)))
  eval-buffer(#<buffer  *load*> nil "/home/wdenton/.emacs.d/.emacs.desktop" nil t)  ; Reading at buffer position 6154
  load-with-code-conversion("/home/wdenton/.emacs.d/.emacs.desktop" "/home/wdenton/.emacs.d/.emacs.desktop" t t)
  load("/home/wdenton/.emacs.d/.emacs.desktop" t t t)
  desktop-read()
  #f(compiled-function () #<bytecode 0x16157c4861c754ea>)()
  run-hooks(after-init-hook delayed-warnings-hook)
  command-line()
  normal-top-level()



  reply	other threads:[~2024-03-16 18:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29  5:13 Things got very slow: profiler output William Denton
2024-02-29  9:21 ` Bruno Barbier
2024-02-29  9:28   ` Ihor Radchenko
     [not found] ` <notmuch-sha1-998a6a574db756b51dbdd759ff59b5174d99c7f1>
2024-02-29  9:25   ` Bruno Barbier
2024-03-07 16:12     ` William Denton
2024-03-07 17:42       ` Bruno Barbier
2024-03-09 19:27       ` William Denton
2024-03-12 12:43         ` Ihor Radchenko
2024-03-13 23:19           ` Bruno Cardoso
2024-03-14  1:17             ` William Denton
2024-03-14  7:34               ` Gerard Vermeulen
2024-03-14 10:27                 ` Bruno Cardoso
2024-03-14 10:22               ` Bruno Cardoso
2024-03-14 21:23             ` Ihor Radchenko
2024-03-15  1:09               ` Bruno Cardoso
2024-03-15 14:24                 ` Ihor Radchenko
2024-03-15 16:33                   ` Bruno Cardoso
2024-03-15 17:18                     ` Ihor Radchenko
2024-03-15 17:49                       ` Bruno Cardoso
2024-03-16  8:56                         ` Ihor Radchenko
2024-03-16 13:31                           ` Bruno Cardoso
2024-03-16 15:56                             ` Ihor Radchenko
2024-03-16 18:39                               ` William Denton [this message]
2024-03-16 18:56                                 ` Ihor Radchenko
2024-03-17 18:59                                   ` William Denton
2024-03-17 19:33                                     ` Ihor Radchenko
2024-03-16 20:21                               ` Bruno Cardoso
2024-03-16 21:14                                 ` Ihor Radchenko
2024-03-17 13:02                                   ` Bruno Cardoso
2024-03-17 14:19                                     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='Thw2P_bFDxJukQTh_Fg125jTlrb4zmciJVc-5xswHWAgORE_DaK-ej0d2Yhi88VLJ0y5-i6IapzOx3fB2l5mrJ1CsbEmCRXA2Dtab6gQnG8=@williamdenton.org' \
    --to=william@williamdenton.org \
    --cc=cardoso.bc@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).