LWN.net Logo

Bad NIH, good NIH

Bad NIH, good NIH

Posted Mar 11, 2013 17:29 UTC (Mon) by sfeam (subscriber, #2841)
In reply to: Bad NIH, good NIH by nye
Parent article: Canonical reveals plans to launch Mir display server (The H)

You (or xterm) are doing something very wrong.
Here's what I get using ssh to a remote machine over a bog-standard comcast consumer cable connection, followed by display of not just a terminal window but full graphics display plus round-trip response to a mouse click. Some toolkits are better than others at negotiating fast response over a remote connection, but all are funneled through x11.

$ssh <remote-machine>

$time gnuplot -e 'set term qt; plot x; pause mouse'
0.058u 0.013s 0:08.18 0.7%

$time gnuplot -e 'set term wxt; plot x; pause mouse'
0.091u 0.034s 0:13.98 0.8%

$time gnuplot -e 'set term x11; plot x; pause mouse'
0.007u 0.058s 0:01.50 3.3%

and here's the time for display only (no wait for mouse click):

$time gnuplot -e 'set term x11; plot x'
0.010u 0.004s 0:00.79 1.2%

That's not to say that response couldn't be improved, but your 37 second latency is horrible for some reason other than x11.


(Log in to post comments)

Bad NIH, good NIH

Posted Mar 11, 2013 23:07 UTC (Mon) by nix (subscriber, #2304) [Link]

I bet his connection is dropping packets, so there's an extra delay caused by TCP timeouts in there.

Bad NIH, good NIH

Posted Mar 12, 2013 12:50 UTC (Tue) by nye (guest, #51576) [Link]

>I bet his connection is dropping packets, so there's an extra delay caused by TCP timeouts in there.

Nope, but there is something interesting to see from the ping statistics while this is going on:

118 packets transmitted, 118 received, 0% packet loss, time 117123ms
rtt min/avg/max/mdev = 42.022/158.507/720.719/168.475 ms

(Obviously this also covers some time before and after.)

Curious as to why my ping time goes up to several hundred ms while xterm is launching, I've discovered that this local machine feels the need to send a few megabytes of data to the remote machine before doing anything.

In fact, it looks like xterm is the culprit here. I don't have many X clients installed on the machine I'm ssh'ing into to test with, but xfontsel at least starts up a lot quicker (a couple of seconds).

If even xterm can't get X network transparency right, what hope is there for everyone else?

Bad NIH, good NIH

Posted Mar 14, 2013 5:48 UTC (Thu) by Serge (guest, #84957) [Link]

> You (or xterm) are doing something very wrong.

You can check that using x11trace tool. Most of the time is taken by sending fonts and other settings. That increases startup time, but makes it work faster, because it does not have to send images, it can reference fonts on the server side.

Xterm is smarter than most people think. It has configurable fonts, colors, hotkeys and many other options. For example to see xterm menu hold Control+Left/Right/Middle mouse button. But the point is that those settings are stored on a server-side (XResource), and xterm reads them all from server during startup.

Some DEs are using that. For example on KDE xterm colors should match your theme, does not matter what host you start xterm from. That's the server-side themes in action. Nobody remembers them any more... (sigh)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds