<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Martin Ankerl &#187; benchmark</title>
	<atom:link href="http://martin.ankerl.com/tag/benchmark/feed/" rel="self" type="application/rss+xml" />
	<link>http://martin.ankerl.com</link>
	<description>No movement is faster than no movement</description>
	<lastBuildDate>Tue, 13 Jul 2010 05:31:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Comprehensive Linux Terminal Performance Comparison</title>
		<link>http://martin.ankerl.com/2007/09/01/comprehensive-linux-terminal-performance-comparison/</link>
		<comments>http://martin.ankerl.com/2007/09/01/comprehensive-linux-terminal-performance-comparison/#comments</comments>
		<pubDate>Sat, 01 Sep 2007 14:16:33 +0000</pubDate>
		<dc:creator>Martin Ankerl</dc:creator>
				<category><![CDATA[benchmark]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://martin.ankerl.com/?p=94</guid>
		<description><![CDATA[Linux has an abundance of excellent terminal applications. Interestingly, I could not find any decent comparison of their text display performance. Since I use the command line a lot, I want text output that is as fast as possible. When you compile a large project, you don&#8217;t want the console output to be the limiting [...]]]></description>
			<content:encoded><![CDATA[<p>Linux has an abundance of excellent terminal applications. Interestingly, I could not find any decent comparison of their text display performance. Since I use the command line a lot, I want text output that is as fast as possible. When you compile a large project, you don&#8217;t want the console output to be the limiting factor.</p>
<h1>System</h1>
<p>Due to popular demand, here is what my test system looks like: Ubuntu 7.04, Gnome, ATI Radion Mobile 9600 with fglrx driver, and a Pentium M with 1.5 GHz.</p>
<h1>The Benchmark</h1>
<p>I took the burden on me to do a comprehensive comparison of the text through of all possible terminals. The benchmark is very simple, I timed displaying the whole content of <a href="http://www.ietf.org/rfc/rfc3261.txt">RFC3261</a>. Download the file if you want to make your own benchmarks. The benchmark is executed like this:</p>
<pre>time cat rfc3261.txt</pre>
<p>I have measured the time in seconds. Without further ado, I give you the results (click <a target="_blank" href="/files/term-bench.pdf">here for a better readable PDF version</a>, or <a target="_blank" href="/files/term-bench.png">click the image for a larger view</a>):</p>
<p><center><br />
<a target="_blank" href="/files/term-bench.png"><br />
<img src="/files/term-small.png" width="400" height="309" /><br />
larger view<br />
</a></p>
<p></center><br />
Runtime in seconds timed with <tt>time cat rfc3261.txt</tt>.</p>
<h1>Results</h1>
<p>These are some very interesting results:</p>
<ul>
<li>Both <tt>gnome-terminal</tt> and <tt>konsole</tt> are exceptionally fast, it takes only 0.25 to 0.59 seconds to display the 647976 bytes large file. They buy the speed with quite a bit of memory consumption, and it can be clearly seen that the output does not smoothly scroll but only updates several times per second. This is a clever trick and has the advantage of being extremely fast, because not every letter needs to be pumped through the X windowing system. If you compile a lot or have other automatically generated output, <tt>gnome-terminal</tt> and <tt>konsole</tt> are the clear winners.
<li><tt>konsole</tt> uses a lot of memory, about 32 MB. When setting the history buffer to 10.000 lines, it increases to 38MB per instance.</li>
<li><tt>gnome-terminal</tt> has a very different memory behavior. When you open multiple terminals, they are all memory managed from one <tt>gnome-terminal</tt> instance. This one instance requires about 45 MB freshly started. When opening multiple terminals and each one with 10.000 lines of used buffer, each terminal requires about 16 MB, so when you open more than three terminals at once you have already lower memory requirements than when using <tt>konsole</tt>.
<li><tt>xterm</tt> is the slowest terminal. While it is probably the most widely used term, the only slower terminal is Microsoft Window&#8217;s <tt>cmd.exe</tt>! Each instance requires 16 MB RAM, which is a lot in comparison to other terms with similar features.
<li><tt>wterm</tt> is both reasonably fast and the most memory efficient of all tested terminals. Each instance requires only about 6.3 MB of RAM, even with 10.000 lines of buffer. Only <tt>aterm</tt> but without buffer comes with 6.5 MB pretty close.
<li>Eterm is quite fast and memory efficient (9 MB), even with transparency.</li>
</ul>
<h1>Conclusion</h1>
<p>So, what is the best terminal? The answer is actually quite simple:</p>
<ul>
<li>If you want speed, use <tt>gnome-terminal</tt> or <tt>konsole</tt>.
<li>If you are low on memory, use <tt>wterm</tt>, <tt>rxvt</tt>, or <tt>Eterm</tt>.
<li><tt>xterm</tt> is slow.
</ul>
<p><b>UPDATE</b>: Of course, the answer is actually not so simple. As some have told me, they get a quite different performance behavior on their system. I suspect that both the linux scheduler and the X scheduler has a lot to say in this issue too. So if you want to have results you can trust, you have to redo the benchmark on your machine. Fortunately, that&#8217;s simple: just cat a large file and measure the time it takes. Be sure to run it multiple times to get more accurate average numbers.</p>
<h1>Other Remarks</h1>
<ul>
<li>Windows does not have the <tt>time</tt> command, so I wrote a simple Ruby script that does the same thing:
<pre class="brush: ruby;">before = Time.now
system(ARGV.join(&quot; &quot;))
after = Time.now
puts &quot;#{after-before} seconds&quot;</pre>
<p>Also, <tt>cmd.exe</tt> only allows 9.999 lines of buffer.</p>
<li>If you want to display bitmap fonts in gnome-terminal, edit <tt>~/.fonts.conf</tt> and add these lines right after the <tt>&lt;fontconfig&gt;</tt> opening tag:
<pre class="brush: xml;"> &lt;!-- Accept bitmap fonts --&gt;
 &lt;selectfont&gt;
  &lt;acceptfont&gt;
   &lt;pattern&gt;
     &lt;patelt name=&quot;scalable&quot;&gt;&lt;bool&gt;false&lt;/bool&gt;&lt;/patelt&gt;
   &lt;/pattern&gt;
  &lt;/acceptfont&gt;
 &lt;/selectfont&gt;</pre>
</ul>
<p>I hope this is helpful in your choice of the best console.</p>
<div style='clear:both'></div><img src="http://martin.ankerl.com/?ak_action=api_record_view&id=94&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://martin.ankerl.com/2007/09/01/comprehensive-linux-terminal-performance-comparison/feed/</wfw:commentRss>
		<slash:comments>87</slash:comments>
		</item>
		<item>
		<title>Exponential Functions: Benchmarks, 8 Times Faster Math.pow()</title>
		<link>http://martin.ankerl.com/2007/02/12/exponential-functions-benchmarks-11-times-faster-mathpow/</link>
		<comments>http://martin.ankerl.com/2007/02/12/exponential-functions-benchmarks-11-times-faster-mathpow/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 15:26:53 +0000</pubDate>
		<dc:creator>Martin Ankerl</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[approximation]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[pow]]></category>

		<guid isPermaLink="false">http://martin.ankerl.com/?p=83</guid>
		<description><![CDATA[I have updated the code for the Math.pow() approximation, now it is 11 times faster on my Pentium IV. Read Optimized Exponential Functions for Java for more information. Now I can also give you some benchmarks: Benchmarks Math.log() &#8212; 11.7 times faster 6.233 sec, Math.log(x) 0.531 sec, 6*(x-1)/ (x + 1 + 4*(Math.sqrt(x))) Math.exp() &#8212; [...]]]></description>
			<content:encoded><![CDATA[<p>I have updated the code for the <tt>Math.pow()</tt> approximation, now it is 11 times faster on my Pentium IV. Read <a href="http://martin.ankerl.com/2007/02/11/optimized-exponential-functions-for-java/">Optimized Exponential Functions for Java  </a> for more information. Now I can also give you some benchmarks:<br />
<span id="more-83"></span></p>
<h1>Benchmarks</h1>
<h4>Math.log() &#8212; 11.7 times faster</h4>
<ul>
<li>6.233 sec, Math.log(x)</li>
<li>0.531 sec, 6*(x-1)/ (x + 1 + 4*(Math.sqrt(x)))</li>
</ul>
<h4>Math.exp() &#8212; 5.3 times faster</h4>
<ul>
<li>5.920 sec, Math.exp(x)</li>
<li>1.108 sec, exp optimized with IEEE 754 trick</li>
</ul>
<h4>Math.pow() &#8212; 8.7 times faster</h4>
<ul>
<li>15.967 sec, Math.pow(a, b)</li>
<li>11.014 sec, e^(b * log(a))</li>
<li>7.607 sec, e^(b * log(a)) + IEEE 754 trick</li>
<li>2.109 sec, e^(b * log(a)) + IEEE 754 trick + LOG approximation</li>
<li>1.827 sec, simplified everything, see <a href="http://martin.ankerl.com/2007/02/11/optimized-exponential-functions-for-java/">Optimized Exponential Functions for Java  </a></li>
</ul>
<p>For accurate measurements I have performed each calculation 20 million times and used a random number generator to prevent optimization. I have measured the overhead of iterating and random number generation (3.969 sec) and substracted this from each measurement so that only the pure functional code is measured.</p>
<div style='clear:both'></div><img src="http://martin.ankerl.com/?ak_action=api_record_view&id=83&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://martin.ankerl.com/2007/02/12/exponential-functions-benchmarks-11-times-faster-mathpow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
