abo-abo/avy

avy working extremely slow

anupam312nwd opened this issue · 1 comments

Hi, avy is working extremely slow on my doom-emacs config, though it working very fast on my simple vanilla-config.

I ran these commands:

(progn
  (elp-instrument-function 'line-move-visual)
  (elp-instrument-package "avy")
  (setq unread-command-events (listify-key-sequence "jj"))
  (avy-goto-line)
  (elp-results))

and got the following results on doom-emacs:

avy-goto-line                  1           24.760091     24.760091
avy--line                      1           24.760078     24.760078
avy-process                    1           24.18779      24.18779
avy--process-1                 1           24.140831     24.140831
avy-read                       1           24.14075      24.14075
avy--overlay-at-full           295         21.708017999  0.0735865016
avy--overlay                   295         14.271306000  0.0483773084
avy--old-str                   295         7.1093379999  0.0240994508
avy--line-cands                1           0.572259      0.572259
line-move-visual               95          0.2882539999  0.0030342526
avy-pre-action-default         1           0.046929      0.046929
avy--update-offset-and-str     295         0.0020630000  6.993...e-06
avy-handler-default            2           0.000557      0.0002785
avy--remove-leading-chars      5           0.000252      5.04e-05
avy--key-to-char               582         0.0002239999  3.848...e-07
avy-traverse                   34          0.0001379999  4.058...e-06
avy-candidate-beg              295         0.0001179999  3.999...e-07
avy-tree                       1           4.3e-05       4.3e-05
avy-push-mark                  1           3.2e-05       3.2e-05
avy-mouse-event-window         4           1.7e-05       4.25e-06
avy-subdiv                     10          1.500...e-05  1.500...e-06
avy--make-backgrounds          1           1.2e-05       1.2e-05
avy--done                      1           9e-06         9e-06
avy-window-list                2           4.999...e-06  2.499...e-06
avy-action-goto                1           3e-06         3e-06
avy--style-fn                  1           1e-06         1e-06

and got following results on vanilla-config:

avy-goto-line                  1           0.453311      0.453311
avy--line                      1           0.453301      0.453301
avy-process                    1           0.452798      0.452798
avy--process-1                 1           0.452722      0.452722
avy-read                       1           0.452697      0.452697
avy--overlay-at-full           54          0.002497      4.624...e-05
avy--overlay                   54          0.0012490000  2.312...e-05
avy--old-str                   54          0.0005080000  9.407...e-06
avy--line-cands                1           0.000494      0.000494
avy--update-offset-and-str     54          0.0001799999  3.333...e-06
avy-handler-default            2           0.000117      5.85e-05
avy-pre-action-default         1           6.5e-05       6.5e-05
avy-push-mark                  1           3.2e-05       3.2e-05
avy--key-to-char               82          2.300...e-05  2.804...e-07
avy--remove-leading-chars      4           2.3e-05       5.75e-06
avy-traverse                   6           1.499...e-05  2.499...e-06
avy-candidate-beg              54          1.400...e-05  2.592...e-07
avy-tree                       1           1.1e-05       1.1e-05
avy-mouse-event-window         3           1.1e-05       3.666...e-06
avy-subdiv                     1           3e-06         3e-06
avy--done                      1           3e-06         3e-06
avy-action-goto                1           2e-06         2e-06
avy-window-list                2           2e-06         1e-06
avy--style-fn                  1           1e-06         1e-06
avy--make-backgrounds          1           0.0           0.0

I am not sure how to even start trying to fix it.
Any direction on how to fix the issue will be much appreciated. Thanks!

The issue is resolved.
I am not sure why but deleting the following code resolved this issue:

(after! evil
  (setq evil-normal-state-cursor '(box "gold")
        evil-insert-state-cursor '(bar "gold")
        evil-visual-state-cursor '(hollow "orange")))