<?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>GuShH&#039;s DevBlog &#187; benchmark</title>
	<atom:link href="http://gushh.net/blog/?tag=benchmark&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://gushh.net/blog</link>
	<description>This blog is about software, electronics engineering and game development.</description>
	<lastBuildDate>Tue, 24 Jan 2012 00:31:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Wikipedia entries, mostly biased.</title>
		<link>http://gushh.net/blog/wikipedia-entries-mostly-biased/</link>
		<comments>http://gushh.net/blog/wikipedia-entries-mostly-biased/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 23:42:53 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[blitzmax]]></category>
		<category><![CDATA[bmx]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[mingw]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[purebasic]]></category>
		<category><![CDATA[wikipedia]]></category>
		<category><![CDATA[wil baden]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/?p=123</guid>
		<description><![CDATA[It was recently brought to my attention that the PB wikipedia entry is brutally biased towards marketing; it&#8217;s not maintained by the people but rather by themselves, the developers. One of the key factors for them is that &#8220;their compiler makes small exes&#8221;&#8230; They never, ever, mention speed. Some time ago I did a bunch [...]]]></description>
			<content:encoded><![CDATA[<p>It was recently brought to my attention that the PB wikipedia entry is brutally biased towards marketing; it&#8217;s not maintained by the people but rather by themselves, the developers.</p>
<p>One of the key factors for them is that &#8220;their compiler makes small exes&#8221;&#8230; They never, ever, mention speed.</p>
<p>Some time ago I did a bunch of benchmarks, in a time where it was uncertain for me which language should I stick to (We all asked this question at least once) and I found some shocking results, but not surprisingly. You see, developing an efficient compiler is not an easy task. However, when someone talks their butt off a certain subject, be sure that they are hiding something else.<span id="more-123"></span></p>
<p>The benchmark ran a few simple, trivial tests such as single and multi-dimensional array access as well as a factorial test. All of which were linear. The languages I chose were C++, BlitzMax and PureBasic.</p>
<p>Results were loud and clear, PB was the slowest of all three tested languages with no exceptions.</p>
<p>For the linear array access, C++ did 700ms whereas BMX (BlitzMax) did 650ms, Sadly PB did 2160ms.</p>
<p>Similar pattern emerged in the multi-dimensional array test with C++ performing a whopping 1250ms against BMX&#8217;s 1750ms, again PB did a lousy job with 4330ms, ouch.</p>
<p>As for the factorial test: C++ 578ms, BMX 590ms, PB 1578ms.</p>
<p>Now, this are averaged results (out of 10 runs each). The versions used of each compiler were the latest, stable releases. And I just finished running the tests again, yielding the results I just showed you (which didn&#8217;t differ much from my old findings anyway).</p>
<p>For C++ I used the GCC frontend, I also compiled with the default switches. Reason being, I wanted to be &#8220;fair&#8221; with the other languages that don&#8217;t seem to provide any compiler switches at all regarding true code optimization. It&#8217;s also good to know that both PB and BMX use similar backends for assembly and BMX itself uses GCC for it&#8217;s C++ integration.</p>
<p>It is clear that PB&#8217;s compiler does a lousy job, period. Whenever you&#8217;re working on an application in the real world, a few extra KBs don&#8217;t matter as long as your program runs FAST. Obviously a more extense set of tests should be created to really call it final, but I don&#8217;t have high hopes for PB since it&#8217;s not a worldclass compiler, it can&#8217;t compete with C++, period.</p>
<p>&#8220;Programmers are the only men who boast how small theirs is.&#8221; &#8211; Wil Baden</p>
<p>Well Mr. Baden, I don&#8217;t. OK, Sometimes&#8230;</p>
<p>For those afraid of C++, did you ever try it or were you too scared of the syntax and decided it was too much for you?, do yourself a favor and look again, this time do make an effort and I promise you&#8217;ll soon get an epiphany the size of an elephant. If not, at least go for C#, Java, or Python! &#8211; Boy there are good choices out there.</p>
<p>You can find the benchmarks along with their source in <a href="http://gushh.net/dls/benchmark_array_factorial_in_cpp_bmx_pb.zip" target="_blank">here</a>.</p>
<p><em>(notice this is quite an old piece of code, specially for the cpp tests; there are certain headers included that shouldn&#8217;t even be there in the first place. you could also get a smaller exe by avoiding iostream alltogether, ha)</em></p>
<p><em><br />
</em></p>
<p>That&#8217;s all I wanted to say, I&#8217;m really tired of how idiotic they can get with their product. It&#8217;s not like they&#8217;re offering something that doesn&#8217;t exist, they don&#8217;t even have a RAD or even the standard libraries and most importantly size doesn&#8217;t matter if you can&#8217;t perform at all&#8230; Oh well, I better wrap it up for now.</p>
<p>Cheers.</p>
<p>&lt;/rant&gt;&lt;/hate&gt;&lt;love&gt;</p>
<g:plusone href='http://gushh.net/blog/wikipedia-entries-mostly-biased/'></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/wikipedia-entries-mostly-biased/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faster ways of finding a character inside a string, in PureBasic.</title>
		<link>http://gushh.net/blog/faster-ways-of-finding-a-character-inside-a-string-in-purebasic/</link>
		<comments>http://gushh.net/blog/faster-ways-of-finding-a-character-inside-a-string-in-purebasic/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 07:20:03 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[ascii]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[char]]></category>
		<category><![CDATA[findchar]]></category>
		<category><![CDATA[findstring]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[purebasic]]></category>
		<category><![CDATA[string manipulation]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/index.php/2008/03/03/faster-ways-of-finding-a-character-inside-a-string-in-purebasic/</guid>
		<description><![CDATA[For those of you who either prototype or work with PureBasic on a daily basis, if you ever found yourself looking for faster ways of performing string manipulation, while still using the string system this language provides, be glad for I&#8217;ll be posting a few of my solutions to speed up the process. My first [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who either prototype or work with PureBasic on a daily basis, if you ever found yourself looking for faster ways of performing string manipulation, while still using the string system this language provides, be glad for I&#8217;ll be posting a few of my solutions to speed up the process.</p>
<p>My first entry is the FindChar() routine. Unlike the official FindString(), this one only searches for a single character. In situations where you&#8217;ll be dealing with single character string searches rather than multi-character, this routine will give you up to 2x speed increase in both Ascii and Unicode modes. Worst case scenario, you&#8217;ll get equal results speed-wise.</p>
<p align="center"><strong>The <em>FindChar() </em></strong><strong> code can be found at &gt; <a href="http://gushh.net/src.php?file=pb/FindChar.pb" target="_blank">here</a><a href="http://gushh.net/src.php?file=pb/FindChar.pb" target="_blank"><span style="font-weight: bold"></span></a> &lt;</strong></p>
<p align="center"><span id="more-16"></span></p>
<p>Due to the fact that Unicode characters are 2bytes long, we must use SizeOf() to perform certain displacement operations. However, this implies the use of at least one division for our final result, this will slow things down in the long-run. So, instead, we hack ourselves into a nastier method and we thank the FPU for it (granted, multiply by 0.5, since we know the character size is constant at 2) As nasty as it is, this allows us to outperform the official routine by almost 2x, still in Unicode.</p>
<p>There are certain things to take care of before doing anything with my routines, and this includes making sure we pass a valid string pointer, while ensuring we never pass negative displacement values and that we don&#8217;t attempt to displace over the limits of the string. Any self-respectable coder will do this before calling any routine, though. If you want an extra push of speed, get rid of the main IF statement in the routine.</p>
<p align="center">The ideal solution for this language would be to trash the actual string library and replace it with a proper one, but I fear this is a task for the author, not us. I also fear, we won&#8217;t be seeing this any time soon. So we might as well keep on sharing our solutions and &#8220;hope&#8221; the author reads a few books on proper software development, and that he understands them.</p>
<p style="font-style: italic">For those of you using Unicode, please beware that this routine has not been extensively tested on a production level. Even though it behaves equally to FindString(), I recommend you to perform at least a few tests before plugging this routine right into your main-code. It&#8217;s worth noting though, most of my string routines work on 0-based displacements but output equally to the official PB ones.</p>
<p align="left"><em> One of this days I&#8217;ll probably end up ranting quite badly on the fact that this sort of languages lack standad support for some really important routines&#8230; On the bright side, they provide quick means of prototyping small pieces of code before getting into production with your main language. Even so, theres no escape on the fact that the author lacks the real-world development experience to provide better solutions for his own product. </em></p>
<p align="left">&nbsp;</p>
<p> That&#8217;s it for now, I&#8217;ll be sharing more as I find time to post in here. Most of the rutines are being used on my in-house XML parser, just so you know. All benchmarks were done on multiple processors and results were averaged on a set of 20 tries per test.</p>
<p>Cheers.</p>
<g:plusone href='http://gushh.net/blog/faster-ways-of-finding-a-character-inside-a-string-in-purebasic/'></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/faster-ways-of-finding-a-character-inside-a-string-in-purebasic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: gushh.net @ 2012-02-09 07:40:47 by W3 Total Cache -->
