<?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; optimization</title>
	<atom:link href="http://gushh.net/blog/?tag=optimization&#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>(PB) Nearest Power of Two in Assembly</title>
		<link>http://gushh.net/blog/pb-nearest-power-assembly/</link>
		<comments>http://gushh.net/blog/pb-nearest-power-assembly/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 11:25:19 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[asm]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[find nearest power of two]]></category>
		<category><![CDATA[nearest power of 2]]></category>
		<category><![CDATA[Nearest power of two]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[pow2]]></category>
		<category><![CDATA[premature optimization]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/?p=1088</guid>
		<description><![CDATA[On today&#8217;s masochism section&#8230; we find the nearest power of two in Assembly! Macro PowerOfTwo&#40; _num_ &#41; !MOV Eax, &#91;v_#_num_&#93; !SUB Eax, 1 !PowerOfTwo_Loop_#_num_: !MOV Ecx, Eax !ADD Eax, 1 !AND Ecx, Eax !JNZ PowerOfTwo_Loop_#_num_ !MOV &#91;v_#_num_&#93;, Eax EndMacro Truth be told I was looking for some old libraries I wrote a while back and [...]]]></description>
			<content:encoded><![CDATA[<p>On today&#8217;s masochism section&#8230; we find the nearest power of two in Assembly!</p>

<div class="wp_syntax"><div class="code"><pre class="purebasic" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">Macro</span> PowerOfTwo<span style="color: #000066;">&#40;</span> _num_ <span style="color: #000066;">&#41;</span>
	<span style="color: #000066;">!</span><span style="color: #000fff;">MOV</span>     Eax, <span style="color: #000066;">&#91;</span>v_#_num_<span style="color: #000066;">&#93;</span>
	<span style="color: #000066;">!</span><span style="color: #000fff;">SUB</span>     Eax, <span style="color: #CC0000;">1</span>
	<span style="color: #000066;">!</span>PowerOfTwo_Loop_#_num_:
	<span style="color: #000066;">!</span><span style="color: #000fff;">MOV</span>     Ecx, Eax
	<span style="color: #000066;">!</span><span style="color: #000fff;">ADD</span>     Eax, <span style="color: #CC0000;">1</span>
	<span style="color: #000066;">!</span><span style="color: #000066; font-weight: bold;">AND</span>     Ecx, Eax
	<span style="color: #000066;">!</span><span style="color: #000fff;">JNZ</span>     PowerOfTwo_Loop_#_num_ 
	<span style="color: #000066;">!</span><span style="color: #000fff;">MOV</span> <span style="color: #000066;">&#91;</span>v_#_num_<span style="color: #000066;">&#93;</span>, Eax
<span style="color: #000066; font-weight: bold;">EndMacro</span></pre></div></div>

<p>Truth be told I was looking for some old libraries I wrote a while back and I stumbled upon that code. It made me chuckle so of course I had to share it. The reason I laughed was because, well&#8230; Who would really need to optimize such a routine?; in those days I was suffering from a severe case of premature-optimizationitis.</p>
<p>However, compared to the normal method which follows:</p>

<div class="wp_syntax"><div class="code"><pre class="purebasic" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">Procedure</span>.i NearestPow2<span style="color: #000066;">&#40;</span> Value.i <span style="color: #000066;">&#41;</span>
	<span style="color: #000066; font-weight: bold;">ProcedureReturn</span> <span style="color: #0000ff;">Pow</span><span style="color: #000066;">&#40;</span> <span style="color: #CC0000;">2</span>, <span style="color: #0000ff;">Int</span><span style="color: #000066;">&#40;</span><span style="color: #000066;">&#40;</span><span style="color: #0000ff;">Log</span><span style="color: #000066;">&#40;</span> Value <span style="color: #000066;">&#41;</span> <span style="color: #000066;">/</span> <span style="color: #0000ff;">Log</span><span style="color: #000066;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">+</span> <span style="color: #CC0000;">0.5</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">&#41;</span>
<span style="color: #000066; font-weight: bold;">EndProcedure</span></pre></div></div>

<p>The ASM routine is about 25 times faster (I benchmarked the code itself without the procedure to be fair, otherwise it would&#8217;ve been 55 times faster!)</p>
<p>So, while unnecessary it still proves a point &#8212; You can always optimize your code for speed. However, the cost is clear&#8230; readability!</p>
<p>I guess it&#8217;s worth stating the obvious in this case: Always benchmark your code and find a balance when it comes to optimization, only optimize your bottlenecks. Don&#8217;t waste time in small details unless the reward is worth the time.</p>
<p>Cheers!</p>
<p>PS: Since the PB pre-processor is case sensitive (who would&#8217;ve known!) Remember that you must pass the macro the same label your variable has, also because we define a label this means we can only call the routine in one place for one particular variable. That however was not an issue with my code, so it never bothered me.</p>
<g:plusone href='http://gushh.net/blog/pb-nearest-power-assembly/'></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/pb-nearest-power-assembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>A fast vector library for purebasic.</title>
		<link>http://gushh.net/blog/a-fast-vector-library-for-purebasic/</link>
		<comments>http://gushh.net/blog/a-fast-vector-library-for-purebasic/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 17:03:31 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[pb]]></category>
		<category><![CDATA[purebasic]]></category>
		<category><![CDATA[resident]]></category>
		<category><![CDATA[sqrt]]></category>
		<category><![CDATA[sse2]]></category>
		<category><![CDATA[vec2]]></category>
		<category><![CDATA[vec3]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/?p=24</guid>
		<description><![CDATA[I recently required some vector functions to prototype a game idea in PureBasic, however there is no such thing as a built-in vector library and any of the existent community code was buggy to say the least (no offense but it&#8217;s old, ugly code that you&#8217;ll find anywhere else). The reason for this library is [...]]]></description>
			<content:encoded><![CDATA[<p>I recently required some vector functions to prototype a game idea in PureBasic, however there is no such thing as a built-in vector library and any of the existent community code was buggy to say the least (no offense but it&#8217;s old, ugly code that you&#8217;ll find anywhere else).</p>
<p>The reason for this library is quite simple, and so is the library itself. you can either include it or install the resource file and start using it right away. After taking a quick look at the source, you&#8217;ll soon familiarize with it&#8217;s naming convention; there is no need to write any documentation for this type of code, since it&#8217;s basic vector math. However a test source is included for your delight.</p>
<p>You can find the source in here: <a href="http://gushh.net/dev/?file=pb/vec3_macro.pbi" target="_blank">http://gushh.net/dev/?file=pb/vec3_macro.pbi</a><br />
And some ugly test code in here: <a href="http://gushh.net/dev/?file=pb/vec3_macro_test.pb" target="_blank">http://gushh.net/dev/?file=pb/vec3_macro_test.pb</a></p>
<p>Or, you can get &#8220;the whole package&#8221; from here: <a href="http://gushh.net/dls/vec3_macro.zip">http://gushh.net/dls/vec3_macro.zip</a></p>
<p>Using this library is as easy as&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="purebasic" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">Define</span>.VEC3 a, b, c
VEC3_SET<span style="color: #000066;">&#40;</span> a, <span style="color: #CC0000;">0.1</span>, <span style="color: #CC0000;">0.2</span>, <span style="color: #CC0000;">0.3</span> <span style="color: #000066;">&#41;</span>
VEC3_SET<span style="color: #000066;">&#40;</span> b, <span style="color: #CC0000;">0.4</span>, <span style="color: #CC0000;">0.5</span>, <span style="color: #CC0000;">0.6</span> <span style="color: #000066;">&#41;</span>
VEC3_ADD<span style="color: #000066;">&#40;</span> a, b, c <span style="color: #000066;">&#41;</span>
VEC3_DEBUG3<span style="color: #000066;">&#40;</span> a, b, c <span style="color: #000066;">&#41;</span> <span style="color: #ff0000; font-style: italic;">; display the vectors in the debug console.</span></pre></div></div>

<p> <br />
<span id="more-24"></span></p>
<p>I mention &#8220;so-called fast&#8221; because it&#8217;s relatively fast, however not as fast as a pure sse2+ implementation would be &#8211; although we remain &#8220;as fast as we can&#8221; without breaking code readability and maintainability at all. This is also 100% cross-platform and as fast as it gets with the current compiler. &#8220;Macrofobics&#8221; could disagree but it&#8217;s their loss.</p>
<p>Some might argue that using a &#8220;fast sqrt&#8221; would be a good thing, but I disagree. You don&#8217;t really need this at all now a days. Also, any implementation of the fast sqrt in PB would not benefit from much speed increase at all, if any you&#8217;ll ruin code readability over a little bit of speed while giving away precision and portability.</p>
<p>That said, feel free to modify as you see fit &#8211; But please share your findings with the community.</p>
<p>If there is a need for a VEC2 lib, I&#8217;ll gladly release it. Remember, you don&#8217;t need a point library / class at all, a vector library can indeed be used for points and it is recommended; cuts unecesarry redundant code and makes your life easier. Perhaps a purist OOP coder would disagree, but I don&#8217;t care.</p>
<p>Have fun with vectors!</p>
<g:plusone href='http://gushh.net/blog/a-fast-vector-library-for-purebasic/'></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/a-fast-vector-library-for-purebasic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>URL Encoding in PureBasic, the proper way.</title>
		<link>http://gushh.net/blog/url-encoding-in-purebasic-the-proper-way/</link>
		<comments>http://gushh.net/blog/url-encoding-in-purebasic-the-proper-way/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 06:07:57 +0000</pubDate>
		<dc:creator>GuShH</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PureBasic]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[pb]]></category>
		<category><![CDATA[purebasic]]></category>
		<category><![CDATA[rfc 3986]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[uri encode]]></category>
		<category><![CDATA[url encoding]]></category>

		<guid isPermaLink="false">http://gushh.net/blog/index.php/2008/03/30/url-encoding-in-purebasic-the-proper-way/</guid>
		<description><![CDATA[The other day I found myself in the need of a compliant url-encoding routine for the PB language, not surprisingly theres none available by default (there are actually no specialized libraries whatsoever, and the little you see is implemented from third-party code&#8230;). So I had to code my own, as always. When no proper framework [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I found myself in the need of a compliant url-encoding routine for the PB language, not surprisingly theres none available by default (there are actually no specialized libraries whatsoever, and the little you see is implemented from third-party code&#8230;).</p>
<p>So I had to code my own, as always. When no proper framework is given, you have to either depend on others to implement it or just do it yourself, since the former requires time and patience&#8230; I always choose the latter <img src='http://gushh.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Heres a standards compliant routine to URL-Encode URIs in PureBasic:</p>
<p>The url_encode() code can be found at &gt; <a HREF="http://gushh.net/src.php?file=pb/URLEncode_rfc3986.pb" TITLE="URLEncode_rfc3986_purebasic">here</a> &lt;</p>
<p><span id="more-18"></span></p>
<p>It complies with the RFC 3986 (the current standard) and it&#8217;s the fastest method available for the language. In my last benchmarks it proved to be 0.20 times faster than the fastest known/shared url-encode routine for this language (however, that one wasn&#8217;t compliant at all!). It&#8217;s also 2.50 times faster than the average suggested &#8220;solutions&#8221; for URL-Encoding in this language.</p>
<p>Notice the character &#8216;%&#8217; being checked in one of the case statements, this is simply to prevent duplicate percent-encodings on already encoded URIs. Speed wise, you could still further optimize this routine here and there, but I personally think it&#8217;s not worth the hassle (readability is still important).</p>
<p><em>The reason I always optimize my routines once I&#8217;m done developing them is simply due to the fact that every little uop you save (or should I say &#8216;shave&#8217;?) counts, whether it&#8217;s a trivial operation or not, it doesn&#8217;t matter! &#8211; that&#8217;s simply a clue: It&#8217;ll give you a reference on how many time you should spend optimizing the routine. Yet in the case of a trivial operation, it doesn&#8217;t mean you should leave it &#8220;as is&#8221;. Again, just because you&#8217;ll call the routine once or twice during runtime doesn&#8217;t mean you can&#8217;t improve it!.</em></p>
<p>Thus if you can up-scale your code, then do it. Not only you&#8217;ll gain execution speed, but also knowledge; that&#8217;s a precious thing to earn.</p>
<g:plusone href='http://gushh.net/blog/url-encoding-in-purebasic-the-proper-way/'></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://gushh.net/blog/url-encoding-in-purebasic-the-proper-way/feed/</wfw:commentRss>
		<slash:comments>1</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 08:09:22 by W3 Total Cache -->
