[Eug-lug] ubuntu xterm strangeness
Bob Miller
kbob at jogger-egg.com
Wed Dec 12 10:51:25 PST 2007
Mike Cherba wrote:
> I noticed this when I was booting a system attached to a USB serial
> device, but eventually localized the issue to xterm itself. Basically
> when you put a lot of text through an xterm the cpu usage on gutsy goes
> way up. like 100%. I've tried the same thing with the generic terminal
> app gnome-terminal and the cpu usage is much lower. This seems odd.
> I'm wondering if there is something broken or at least terribly
> sub-optimal in one of the libraries used.
I did some benchmarking. If xterm uses its default font, fixed, it
has about 16x higher throughput than gnome-terminal. If both use the
same freetype font, xterm has 0.4x the throughput of gnome-terminal.
In all cases, one CPU is pegged.
Under xterm, font fixed:
% time sh -c 'od /boot/vmlinuz-2.6.22-14-generic | head -100000'
0.204u 0.100s 0:08.05 3.7% 0+0k 0+0io 0pf+0w
Under gnome-terminal, default font (dunno what it is):
% time sh -c 'od /boot/vmlinuz-2.6.22-14-generic | head -100000'
0.212u 0.100s 2:14.62 0.2% 0+0k 0+0io 0pf+0w
Under xterm, font "monospace 9":
% time sh -c 'od /boot/vmlinuz-2.6.22-14-generic | head -100000'
0.204u 0.076s 5:24.08 0.0% 0+0k 0+0io 0pf+0w
Under gnome-terminal, font "monospace 9":
% time sh -c 'od /boot/vmlinuz-2.6.22-14-generic | head -100000'
0.204u 0.084s 2:16.31 0.2% 0+0k 0+0io 0pf+0w
Top and gkrellm showed that the X server was pegged at 99-100% each
time, so we're really measuring the X server's font rendering speed.
Neigher xterm nor gnome-terminal uses significant CPU - 0.3 seconds
user+sys.
So the first question is, are you using a Freetype font on xterm?
--
Bob Miller K<bob>
kbob at jogger-egg.com
More information about the EUGLUG
mailing list