mosh slow at rendering vim windows with 256-color colorschemes #487

Closed
dorserg opened this Issue Jan 9, 2014 · 7 comments

Comments

Projects
None yet
3 participants

dorserg commented Jan 9, 2014

My set up is mosh -> screen -> vim session.

I recently switched from default 8-color colorscheme to a 256-color one (e.g. https://github.com/tomasr/molokai or http://www.vim.org/scripts/script.php?script_id=415), and noticed that rendering of a window Vim is in became pretty slow -- a couple lines at a time, taking about a second to render the full window (this is on a big monitor). This happens either when I switch from one screen window to the one Vim is in, or when I jump to a remote part of the file within Vim itself, causing it to show/render completely new lines of code (e.g. jump from the beginning of the file to line 500).

It seems related to 256 colors because if you either

  1. force Vim to only use 8 colors (:set t_Co=8 at the beginning of your .vimrc before the colorscheme is applied), or
  2. use default colorscheme (which only uses 8 colors),
    rendering becomes fast.

One other thing to note is, if you substitute mosh with ssh (i.e. ssh -> screen -> vim), it renders both 8- and 256-color colorschemes fast.

Would be great if you could look into this. Thanks!

Owner

keithw commented Jan 9, 2014

Hello,

Thanks for the report.

How big is your terminal (rows/cols), and what is the architecture (CPU/operating system) of the client and server?

We have a lot of room for improvement in how we calculate the diff for each new frame.

dorserg commented Jan 9, 2014

Thanks for the prompt answer.

Dimensions are 90 rows X 280 cols (full screen terminal on a big monitor), give or take for screen status bar and Vim's line numbers column.

The client is Mac OS X (MBP laptop), the server is CentOS.
Mosh version is 1.2.4 on the client, 1.2.3 on the server FWIW.

Member

cgull commented Jan 10, 2014

On 1/9/14 1:05 PM, Sergey Doroshenko wrote:

Thanks for the prompt answer.

Dimensions are 90 rows X 280 cols (full screen terminal on a big
monitor), give or take for screen status bar and Vim's line numbers
column.

The client is Mac OS X (MBP laptop), the server is CentOS.
Mosh version is 1.2.4 on the client, 1.2.3 on the server FWIW.


Reply to this email directly or view it on GitHub
keithw#487 (comment).

I'm actually working on performance issues in redraw in Mosh, though
probably not the same ones you're having.

What terminal emulator are you using on the MBP?

And can you share a screenshot of one of these slow screens, so we can
get an idea of the complexity involved?

--jh

dorserg commented Jan 10, 2014

Terminal is the default terminal app that comes with Mac OS.

Screenshot attached.

screen shot 2014-01-10 at 9 53 13 am

Member

cgull commented Jan 12, 2014

I finally got some time to try and reproduce this, and I think I have, with mosh to localhost on a mid-2009 Mac Mini and a 315x101 window. mosh-client and mosh-server are eating enough CPU to fully load the system, I think. The code I'm working on does appear to improve things considerably (though not quite as much as I'd like).

Things that would be interesting to know to help in reproducing this:

  • What's the bandwidth & latency of the link between client and server?
  • What sort of CPUs do your server and MBP have? How many cores?

I'm not going to have any immediate answers; my code is still buggy and I'm traveling for a week and will be busy and may not have the correct machines/network environment to look at one aspect of your particular problem. I think mosh-server may not be able to consume input from the pty fast enough, which might perversely cause it to have to do many refreshes of the frame buffer and slow it down more.

dorserg commented Jan 13, 2014

My MBP has one 4-core i7 processor. Multiple cores on server side, plenty of bandwidth and super-fast link (won't go into specific numbers, as those are probably not public).
In any case, doesn't look like hardware is the bottleneck here. As I noted in the opening comment, SSH renders everything fast, but mosh hiccups on 256-color data.

Member

cgull commented Dec 10, 2015

Closing, I've committed code that should fix this. Please open a new issue if you still have performance issues.

cgull closed this Dec 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment