Confirmed, for Emacs 31.1 using Org 9.8.7 (bundled with Emacs).

I ran the profiler (profiler-start, <do a bunch of typing in a large
block>, profiler-report, profiler-stop) and it looks like a fair amount of
work going into font lock, which I guess makes sense from the standpoint of
working over a large block of text. I'm not familiar enough with this to
say where there might be efficiency gains or if there's a bug here that's
making it slower.

Cheers,

Derek

        4307  65% - redisplay_internal (C function)
        3190  48%  - jit-lock-function
        3190  48%   - jit-lock-fontify-now
        3157  48%    - jit-lock--run-functions
        3157  48%     - #<byte-code-function C77>
        3157  48%      - font-lock-fontify-region
        3157  48%       - font-lock-default-fontify-region
        3050  46%        - font-lock-fontify-keywords-region
         761  11%         - org-activate-links
         761  11%            re-search-forward
         660  10%         - org-activate-folds
         547   8%          - org-fold-core-get-folding-spec
         165   2%             get-char-property
         106   1%             buffer-local-value
          98   1%           + org-fold-core--property-symbol-get-create
           8   0%             reverse
           4   0%             org-element-type
          66   1%            search-forward
         248   3%         + org-fontify-meta-lines-and-blocks
         228   3%         + org-do-emphasis-faces
         192   2%         + org-fontify-inline-src-blocks
          53   0%         + org-fontify-macros
          53   0%         + org-fontify-drawers
          36   0%           org-cite-activate
          31   0%         + org-activate-code
          25   0%         + org-activate-dates
          19   0%         + org-font-lock-add-priority-faces
          19   0%         + org-activate-tags
          15   0%         + org-activate-footnote-links
           4   0%           org-font-lock-add-tag-faces
           4   0%           eval
          96   1%        + font-lock-unfontify-region
          11   0%          font-lock-extend-region-multiline
          28   0%      put-text-property
          14   0%    file-remote-p
           6   0%  + eval
        1955  29%   Automatic GC
         216   3% + command-execute
          93   1% + timer-event-handler
           0   0%   ...



On Tue, Nov 3, 2026 at 5:55 PM Anoncheg <[email protected]> wrote:

> Hi, I have custom block in test.org file:
>
> #+begin_cui
> Much of text here (2319 lines, 573 sentences, 15713 words, and 112229
> characters)
> ...
> #+end_cui
>
> I open file this way: `emacs --no-site-file -Q test.org`.
>
> When I type characters anywhere near or inside this block, I experience
> some delay and
>  high CPU load. If there isn’t much text inside the block, there are no
> freezes. The same issue
>  occurs when I enable support for this block in Org-mode as follows:
> ```
>  (add-to-list 'org-protecting-blocks "cui")
>  (add-to-list 'org-babel-tangle-lang-exts '("cui" . "cui"))
> ```
>
> `(print system-configuration-options)` :
> ```n
>  "--prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
> --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
> --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share
> --disable-silent-rules --docdir=/usr/share/doc/emacs-31.1-r2
> --htmldir=/usr/share/doc/emacs-31.1-r2/html --libdir=/usr/lib64
> --program-suffix=-emacs-31 --includedir=/usr/include/emacs-31
> --infodir=/usr/share/info/emacs-31 --localstatedir=/var
> --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
> --without-compress-install --without-pop --without-systemduserunitdir
> --with-file-notification=inotify --with-pdumper --enable-acl --enable-xattr
> --without-dbus --without-modules --without-gameuser --with-libgmp
> --without-gpm --without-native-compilation --without-lcms2 --with-xml2
> --without-mailutils --without-selinux --without-sqlite3 --with-gnutls
> --without-libsystemd --with-threads --with-tree-sitter --without-wide-int
> --with-sound=no --with-zlib --with-pgtk --without-x --without-ns
> --with-toolkit-scroll-bars --without-gconf --without-gsettings
> --without-harfbuzz --without-libotf --without-m17n-flt --without-xwidgets
> --with-gif --with-jpeg --with-png --with-rsvg --without-tiff --with-webp
> --without-imagemagick --with-dumping=pdumper 'CFLAGS=-O2 -march=raptorlake
> -pipe -fno-fast-math -ffp-contract=off' 'CPPFLAGS= -DUSE_VALGRIND=no'
> 'LDFLAGS=-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs'" [2 times]
> ```
>
> Please help find the reason for the high CPU load.
> --
> Best regards,
> Python+Java+Bash+Lisp Data Scientist, AI Engineer without a job for 4
> years.
> PGP pub key: DB8A27FEDA7B4545603396FFC81251BC87659B81
>
>

-- 
+---------------------------------------------------------------+
| Derek Chen-Becker                                             |
| GPG Key available at https://keybase.io/dchenbecker and       |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---------------------------------------------------------------+

Reply via email to