Better (n)vim scrolling performance inside of tmux
I have recently been comparing two setups:
- a file buffer and terminal open side-by-side in an nvim instance using a whole tmux window
- a tmux window containing nvim in one pane and a shell instance in the other
Setup 1 feels much snappier to me, as if it's running at twice the framerate. Not sure if this is thanks to nvim's asynchronous job control or what but it makes a substantial difference on my relatively low-end hardware (i3 & HD3000 graphics). I use native tmux windows/splits as opposed to the iTerm integrated ones out of habit.
I ran a very crude benchmark of the setups described above consisting of measuring the time taken to print the first 200,000 numbers to stdout. Bizarrely, setup 2 was slightly quicker even though it appeared jerky or "low framerate" compared to setup 1.
Strangely, this performance gain disappears when I run nvim outside of tmux; setup 1 minus tmux feels as slow as setup 2. I checked with "regular" vim too and had the same thing. Running with an empty configuration doesn't make a difference.
Initially I was unsure of the cause of this behaviour but in Terminal.app the performance of setup 1 isn't affected by running in or outside of tmux. I tried a fresh profile in iTerm but I haven't found any settings that fix the issue.
Running iTerm2 nightly on 10.11.3.