Skip to content

Evil slows down org-table-align significantly #1623

@dinkonin

Description

@dinkonin

Issue type

  • Bug report

Environment

Emacs version: GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)
Operating System: Archlinux
Evil version: 1.15.0
Evil installation type: manual
Graphical/Terminal: Graphical
Tested in a make emacs session No

Reproduction steps

Open on a large orgmode table with long columns with evil-enabled in an emacs -Q session, choose a column and do M-x org-table-delete-column:

Expected behavior

It takes 2 seconds to complete (with a fairly large table) without (require 'evil) (evil-mode 1)

Actual behavior

When I enable evil it takes 8-10 seconds

Further notes

Profiler output WITH evil enabled:

6722 100% - command-execute
6145  91%  - funcall-interactively
6145  91%   - execute-extended-command
6145  91%    - command-execute
6145  91%     - funcall-interactively
6126  91%      - org-table-delete-column
5922  88%       - org-table-align
4024  59%        - cl-mapcar
4020  59%         - cl--mapcar-many
4017  59%          - org-table--align-field
3905  58%           - org-string-width
3748  55%            - set-window-buffer
3745  55%             - apply
3742  55%              - ad-Advice-set-window-buffer
3717  55%               - evil-local-mode
3200  47%                - add-hook
3197  47%                 - #<compiled 0x1afd915d64e7724e>
407   6%                    alist-get
494   7%                + evil-initialize-state
4   0%                  evil--jumps-install-or-uninstall
22   0%               + #<subr set-window-buffer>
129   1%            + #<compiled -0x1c88ca61cb76bc97>
8   0%            + version<
1728  25%        + org-string-width
56   0%        + org-font-lock-ensure
71   1%       + org-fold-core--fix-folded-region
35   0%       + org-element--cache-after-change
30   0%       + org-at-table-p
8   0%       + jit-lock-after-change
577   8%  + byte-code

Profiler output WITHOUT evil enabled:

1323  65% - timer-event-handler
1323  65%  + apply
530  26% - command-execute
413  20%  - funcall-interactively
413  20%   - execute-extended-command
413  20%    - command-execute
413  20%     - funcall-interactively
392  19%      - org-table-delete-column
342  17%       - org-table-align
160   7%        + #<compiled -0x222b0ce9fbbe5dc>
117   5%        + org-font-lock-ensure
18   0%        + jit-lock-after-change
11   0%        + org-string-width
10   0%        + cl-mapcar
16   0%       + org-at-table-p
4   0%         org-table-goto-column
117   5%  + byte-code
146   7% + ...
7   0% + redisplay_internal (C function)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions