emacs-evil / emacs-evil/evil

evil-refresh-cursor on every set-window is slow

Open
#696 2 comments 1 reaction 0 assignees View on GitHub
bug major
Dominant language
Emacs Lisp
Stars
3.9k
Forks
307
PR merge metrics
No merged PRs in 30d

Description

Originally reported by: **tchajed (Bitbucket: [tchajed](https://bitbucket.org/tchajed), GitHub: [tchajed](https://github.com/tchajed))**

----------------------------------------

I'm running into a performance problem in Proof General (PG) with evil setting the cursor color on every window change. Whenever PG interacts with the prover, it interacts with every window (I'm not exactly sure what it's doing, but among other things it might re-layout its response and goals windows). This triggers a bunch of set-window calls, which cause redisplays as the cursor color is repeatedly changing - these are unnecessary since ultimately PG will return to the same window, and slow down the operation a great deal with re-displays.

This can be reproduced in PG with a simple file, say just

```
#!coq

Check Set.
```

Try `C-c C-n` and `C-c C-u` - these are much slower in insert mode than normal mode. Open some random windows in the same frame and the problem becomes worse.

Arguably the real solution is for Emacs to natively support a per-window cursor color.

I think one way evil can work around this for now is to rate limit how often it sets the cursor color - something like using a timer to ensure that the cursor color is set no more than once every 100ms. Then PG's rapid evil-refresh-cursor calls would collapse to one every 100ms, which shouldn't be slow.

I'm running Emacs 25.1.1 (installed from Homebrew, compiled from source) and using evil 20160619.2253 from Melpa in OS X 10.10 Yosemite.

----------------------------------------
- Bitbucket: https://bitbucket.org/lyro/evil/issue/696

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.