<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Don&#8217;t always trust javadocs</title>
	<atom:link href="http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/</link>
	<description>Programming, Web and all things Computer.</description>
	<lastBuildDate>Sat, 31 Jul 2010 12:48:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Si</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-4075</link>
		<dc:creator>Si</dc:creator>
		<pubDate>Mon, 03 Dec 2007 11:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-4075</guid>
		<description>For speed related regular expressions you are recommended to use the Pattern / Matcher classes in Java5. Also while it is not an issue for simple tokenizing, more complicated Regex can cause a performance hit if you code it incorrectly.</description>
		<content:encoded><![CDATA[<p>For speed related regular expressions you are recommended to use the Pattern / Matcher classes in Java5. Also while it is not an issue for simple tokenizing, more complicated Regex can cause a performance hit if you code it incorrectly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-909</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 09 Jul 2007 16:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-909</guid>
		<description>Just curious...  How many times were you calling String.split()?  Was it just one time and it still was 4-5 times slower than tokenizer?  Or was it many times.  If it was many times, I would expect it to be slower since internally, String.split() is compiling a regex Pattern, an expensive operation.  If you need to split many String objects, all using the same regex, you will get much better performance by using Pattern.split(), which will only compile the Pattern one time.  The split() methods in String are only considered &quot;convenience&quot; methods.

Regards,

Dan</description>
		<content:encoded><![CDATA[<p>Just curious&#8230;  How many times were you calling String.split()?  Was it just one time and it still was 4-5 times slower than tokenizer?  Or was it many times.  If it was many times, I would expect it to be slower since internally, String.split() is compiling a regex Pattern, an expensive operation.  If you need to split many String objects, all using the same regex, you will get much better performance by using Pattern.split(), which will only compile the Pattern one time.  The split() methods in String are only considered &#8220;convenience&#8221; methods.</p>
<p>Regards,</p>
<p>Dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus Kohler</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-93</link>
		<dc:creator>Markus Kohler</dc:creator>
		<pubDate>Fri, 04 May 2007 11:59:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-93</guid>
		<description>Hi, 
Even StringTokenizer is not very efficient, if you don&#039;t need all the features it supports. 

If you only need to split by one char, you can write a routine that is several times faster and allocates much fewer objects than StringTokenizer does

Regards,
Markus</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Even StringTokenizer is not very efficient, if you don&#8217;t need all the features it supports. </p>
<p>If you only need to split by one char, you can write a routine that is several times faster and allocates much fewer objects than StringTokenizer does</p>
<p>Regards,<br />
Markus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evgeniy</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-14</link>
		<dc:creator>Evgeniy</dc:creator>
		<pubDate>Sat, 07 Apr 2007 17:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-14</guid>
		<description>In the end you can just grab StringTokenizer.java from JDK&#039;s src.zip and go with it forever, even after it&#039;s removed from JDK.</description>
		<content:encoded><![CDATA[<p>In the end you can just grab StringTokenizer.java from JDK&#8217;s src.zip and go with it forever, even after it&#8217;s removed from JDK.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vvs</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-12</link>
		<dc:creator>vvs</dc:creator>
		<pubDate>Thu, 05 Apr 2007 22:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-12</guid>
		<description>Thanks, K. Will take a look. Luckily for us, we have very simple file format, and most probably StringTokenizer is enough. On anything more complex, I&#039;d imagine, more powerful libraries will be quite handy!</description>
		<content:encoded><![CDATA[<p>Thanks, K. Will take a look. Luckily for us, we have very simple file format, and most probably StringTokenizer is enough. On anything more complex, I&#8217;d imagine, more powerful libraries will be quite handy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: K</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-11</link>
		<dc:creator>K</dc:creator>
		<pubDate>Thu, 05 Apr 2007 22:51:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-11</guid>
		<description>You should try the CSV Parser from Ostermiller

http://ostermiller.org/utils/CSV.html</description>
		<content:encoded><![CDATA[<p>You should try the CSV Parser from Ostermiller</p>
<p><a href="http://ostermiller.org/utils/CSV.html" rel="nofollow">http://ostermiller.org/utils/CSV.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Attardi</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-8</link>
		<dc:creator>Joe Attardi</dc:creator>
		<pubDate>Thu, 05 Apr 2007 15:13:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-8</guid>
		<description>vvs:

I suppose that makes sense. Fair enough! :-)</description>
		<content:encoded><![CDATA[<p>vvs:</p>
<p>I suppose that makes sense. Fair enough! <img src='http://blog.emptyway.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vvs</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-7</link>
		<dc:creator>vvs</dc:creator>
		<pubDate>Thu, 05 Apr 2007 09:17:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-7</guid>
		<description>Joe, sure, being working in Java SE/ME conformance teams for years, I *do* trust the javadocs a great deal. :) That&#039;s why when I saw a note that StringTokenizer should not be used, I tried to make the suggested change, only to figure out that the new code is a bit too slow for my purposes. 

As for the future, within the next two years, the hardware will become faster, and by then the performance of StringTokenizer will not probably matter much... :)</description>
		<content:encoded><![CDATA[<p>Joe, sure, being working in Java SE/ME conformance teams for years, I *do* trust the javadocs a great deal. <img src='http://blog.emptyway.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  That&#8217;s why when I saw a note that StringTokenizer should not be used, I tried to make the suggested change, only to figure out that the new code is a bit too slow for my purposes. </p>
<p>As for the future, within the next two years, the hardware will become faster, and by then the performance of StringTokenizer will not probably matter much&#8230; <img src='http://blog.emptyway.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Attardi</title>
		<link>http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/comment-page-1/#comment-6</link>
		<dc:creator>Joe Attardi</dc:creator>
		<pubDate>Wed, 04 Apr 2007 20:34:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emptyway.com/2007/04/04/dont-always-trust-javadocs/#comment-6</guid>
		<description>Seeing how the Javadocs are generated directly from source code comments, I&#039;d say it&#039;s pretty safe to trust them. The javadocs for StringTokenizer make no guarantees about performance. So your point about what the javadocs say are pretty much irrelevant to the performance debate.

Should you use code that has been explicitly stated as being legacy code just because it performs better? I&#039;m not so sure. I can almost promise you that in another version or two, StringTokenizer will become deprecated. Will you still advocate its use then?</description>
		<content:encoded><![CDATA[<p>Seeing how the Javadocs are generated directly from source code comments, I&#8217;d say it&#8217;s pretty safe to trust them. The javadocs for StringTokenizer make no guarantees about performance. So your point about what the javadocs say are pretty much irrelevant to the performance debate.</p>
<p>Should you use code that has been explicitly stated as being legacy code just because it performs better? I&#8217;m not so sure. I can almost promise you that in another version or two, StringTokenizer will become deprecated. Will you still advocate its use then?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
