LWN.net Logo

Bad NIH, good NIH

Bad NIH, good NIH

Posted Mar 14, 2013 5:43 UTC (Thu) by Serge (guest, #84957)
In reply to: Bad NIH, good NIH by nye
Parent article: Canonical reveals plans to launch Mir display server (The H)

> $time xterm -e /bin/true
> real 0m0.359s
> user 0m0.032s
> sys 0m0.036s

Wow. I couldn't get it that slow even on a slowest Intel Atom netbook I could find. Was that the worst test of many?

Anyway, your samples confirm that running application remotely is slower than running it locally. That was obvious even without testing. :) If you wanted to say that applications should start faster under Wayland than under Xorg, you should test something like:

$ time xterm
real 0m0.066s
user 0m0.024s
sys 0m0.008s

$ time weston-terminal
real 0m0.095s
user 0m0.064s
sys 0m0.028s

But even that test does not necessary mean that X is faster than Wayland. It just means, that xterm starts faster. Both times are good enough. And X11 is not a bottleneck for faster program startup time. If you actually need faster startup over network right away you can try winswitch.org/xpra.

PS: When benchmarking some soft do multiple tests and select the best result. Also don't forget to switch cpufreq governor to "performance" otherwise you're benchmarking your governor, not your soft.


(Log in to post comments)

Bad NIH, good NIH

Posted Mar 14, 2013 11:24 UTC (Thu) by nye (guest, #51576) [Link]

>Wow. I couldn't get it that slow even on a slowest Intel Atom netbook I could find. Was that the worst test of many?

No, but many repeated runs do bring it down to 0.109s in the best case.
I think this is an example where the first case is the relevant one though, because that's what you'd experience in real use.

To be fair, I don't know if the video device and driver in use have any bearing on this, but just in case it does it's worth noting that I'm running on a laptop with Intel integrated graphics, where I have historically found the quality of both hardware and driver ranges from 'awful' to 'unspeakably awful'.

> If you wanted to say that applications should start faster under Wayland than under Xorg, you should test something like:

I just wanted to disagree with your claim that slow startup is not an issue, because it very frequently is when you are running remote X clients. It happens that the example you picked was one that demonstrated the difference particularly clearly.

Bad NIH, good NIH

Posted Mar 15, 2013 9:01 UTC (Fri) by Serge (guest, #84957) [Link]

> No, but many repeated runs do bring it down to 0.109s in the best case. I think this is an example where the first case is the relevant one though, because that's what you'd experience in real use.

It depends on what do you want to benchmark. If you're just curious "how fast would it be next time I try" then yes. But if your goal is to compare two programs then you must reduce impact of all other obstacles, i.e. cpu throttles, disk cache, memory/swap, other programs running, etc.

> I just wanted to disagree with your claim that slow startup is not an issue, because it very frequently is when you are running remote X clients. It happens that the example you picked was one that demonstrated the difference particularly clearly.

I was just trying to say that "core protocol imposes restrictions that cannot be avoided (e.g. slow startup due to multiple roundtrips)" is not true. Slow startup is not X11 issue when running locally. Wayland only makes things worse. Applications would ofter start slower on Wayland because they're expected to talk to hardware, which requires additional steps for hardware initialization.

As for remote startup it's not that fast because of software, not because of protocol limitations. For example it could be much faster if xterm was sending requests in batch instead of waiting for response every time before sending another request. But people are lazy... They don't like optimizing things. But they like rewriting things from scratch somewhy. It's not a problem of X11 protocol, it's a human problem.

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