<?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>LoadRunner TnT &#187; string</title>
	<atom:link href="http://www.loadrunnertnt.com/tag/string/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.loadrunnertnt.com</link>
	<description>Performance Testing, LoadRunner Tips &#38; Tricks</description>
	<lastBuildDate>Mon, 08 Mar 2010 07:57:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Achieving High Performance Application in Java Coding! – Part 3</title>
		<link>http://www.loadrunnertnt.com/coding/achieving-high-performance-application-in-java-coding-%e2%80%93-part-3/</link>
		<comments>http://www.loadrunnertnt.com/coding/achieving-high-performance-application-in-java-coding-%e2%80%93-part-3/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 15:22:07 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[optimizing]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=694</guid>
		<description><![CDATA[Code with performance in mind!  Follow these next 7 good coding practises that can be easily achieved for high performance!

Beware of “Thread.run()” versus the real intend of “Thread.start()” – We may unknowingly code the thread as “run()”.  This will cause the thread to run sequentially instead of concurrently. Beware of this!  Use “Thread.start()” to allow [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.loadrunnertnt.com/wp-content/uploads/2010/02/web_coding_collage-150x150.jpg"><img class="size-full wp-image-698 alignright" title="web_coding_collage-150x150" src="http://www.loadrunnertnt.com/wp-content/uploads/2010/02/web_coding_collage-150x150.jpg" alt="" width="81" height="81" /></a>Code with performance in mind!  Follow these next 7 good coding practises that can be easily achieved for high performance!<span id="more-694"></span></p>
<ul>
<li><strong>Beware of “Thread.run()” versus the real intend of “Thread.start()”</strong> – We may unknowingly code the thread as “run()”.  This will cause the thread to run sequentially instead of concurrently. Beware of this!  Use “Thread.start()” to allow the thread to run concurrently.</li>
<li><strong>Use “String.length ()  == 0” instead of “String.equals(“”)”</strong> – Both constructs do the same thing of comparing if any characters exists for the string. However, the first construct, “String.length() == 0” is more efficient than the latter one.</li>
<li><strong>Avoid calling “String.toCharArray()”</strong> – “toCharArray()” method is inefficient as the method reallocates the entire array stored in the string.  However, sometimes this is necessary.  Therefore, as a rule, avoid using “toCharArray()” method if possible.  If not possible, do use it with care.</li>
<li><strong>Place “try/catch/finally” block outside loop &#8211; </strong>Placing &#8220;try/catch/finally&#8221; blocks inside loops can slow down the execution of code. Do take note that moving the &#8220;try/catch/finally&#8221; block outside the loop can change program behaviour. An exception that has the “try/catch/finally” block outside the loop will terminate early.  On the other hand, the &#8220;try/catch/finally&#8221; block inside the loop may cause the program to continue iterating over the loop even after an exception has occurred.</li>
<li><strong>Use “StringBuffer.Append ()” instead of “+=” operators for concatenating strings </strong>– “Append()” has better improvement over “+=” operators and its recommended to use it instead of “+=” operators for concatenating strings.</li>
<li><strong>Do not use “StringBuffer” as constants </strong>– Dynamically resizable strings are unnecessary for constant strings (as they do not change).  Instead, use “String” for non-modifiable string constants.</li>
<li><strong>Do not open or close JDBC connections in loops </strong>– It is inefficient to open and close a connection in loop.  Instead, the connection should be opened before the loop and closed after the loop to avoid redundant calls make to the database.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/coding/achieving-high-performance-application-in-java-coding-%e2%80%93-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
