<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: 4.2 &#8211; Julian Bucknall</title>
	<atom:link href="http://delphi.org/2008/09/episode-4-julian-bucknall-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://delphi.org/2008/09/episode-4-julian-bucknall-part-2/</link>
	<description>The Podcast about the Delphi programming language, tools, news and community.</description>
	<lastBuildDate>Wed, 22 Feb 2012 11:47:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Barry Kelly</title>
		<link>http://delphi.org/2008/09/episode-4-julian-bucknall-part-2/comment-page-1/#comment-132</link>
		<dc:creator>Barry Kelly</dc:creator>
		<pubDate>Wed, 10 Sep 2008 13:51:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.delphi.org/?p=180#comment-132</guid>
		<description>I should finally point out that I chose linear probing over heap reference chaining for cache effects in longer-running programs, where memory allocations will be scattered throughout memory, within the limitations of generics at the time of writing. Dynamic arrays were mandatory; static arrays of generic types couldn&#039;t have their element sizes calculated in early versions of the compiler. Similarly, there were restrictions on using generic types inside themselves, and some other issues which have since been fixed, but not early enough to afford a redesign of the dictionary implementation.</description>
		<content:encoded><![CDATA[<p>I should finally point out that I chose linear probing over heap reference chaining for cache effects in longer-running programs, where memory allocations will be scattered throughout memory, within the limitations of generics at the time of writing. Dynamic arrays were mandatory; static arrays of generic types couldn&#8217;t have their element sizes calculated in early versions of the compiler. Similarly, there were restrictions on using generic types inside themselves, and some other issues which have since been fixed, but not early enough to afford a redesign of the dictionary implementation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barry Kelly</title>
		<link>http://delphi.org/2008/09/episode-4-julian-bucknall-part-2/comment-page-1/#comment-131</link>
		<dc:creator>Barry Kelly</dc:creator>
		<pubDate>Wed, 10 Sep 2008 12:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.delphi.org/?p=180#comment-131</guid>
		<description>Also, I should add that rehashing the way Julian described is problematic unless the stride is relatively prime (no common factors) to the hash table size. If the hash table size was itself prime, that would be trivially true, but for a power of two size we&#039;d have to eliminate 2 from all the factors of the calculated stride. The specific problem is that only relatively prime strides will eventually iterate through every bucket index. For a counter-example, consider a table of size 8 and a stride of length 4; if it starts at 3, say, it will simply loop between 3 and 7, and won&#039;t find empty slots elsewhere.

Another knock against rehashing is that you can&#039;t delete from a table that uses rehashing, because you don&#039;t know how far back to move an item to fill in any gaps in any possible rehash-probing sequences. You can use a tombstone for this, and periodically (i.e. by calculating that you have too many tombstones) re-insert everything in the dictionary to clear out the tombstones.</description>
		<content:encoded><![CDATA[<p>Also, I should add that rehashing the way Julian described is problematic unless the stride is relatively prime (no common factors) to the hash table size. If the hash table size was itself prime, that would be trivially true, but for a power of two size we&#8217;d have to eliminate 2 from all the factors of the calculated stride. The specific problem is that only relatively prime strides will eventually iterate through every bucket index. For a counter-example, consider a table of size 8 and a stride of length 4; if it starts at 3, say, it will simply loop between 3 and 7, and won&#8217;t find empty slots elsewhere.</p>
<p>Another knock against rehashing is that you can&#8217;t delete from a table that uses rehashing, because you don&#8217;t know how far back to move an item to fill in any gaps in any possible rehash-probing sequences. You can use a tombstone for this, and periodically (i.e. by calculating that you have too many tombstones) re-insert everything in the dictionary to clear out the tombstones.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barry Kelly</title>
		<link>http://delphi.org/2008/09/episode-4-julian-bucknall-part-2/comment-page-1/#comment-130</link>
		<dc:creator>Barry Kelly</dc:creator>
		<pubDate>Wed, 10 Sep 2008 12:41:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.delphi.org/?p=180#comment-130</guid>
		<description>Julian is wrong about the linear probing versus rehashing, in so far as his comments apply to .NET and Delphi 2009, at least.

Delphi 2009&#039;s TDictionary use linear probing, *not* rehashing, for collision resolution. The dictionary size is a power of two for speed of hash code -&gt; table index calculation, to avoid a division.

.NET&#039;s Dictionary uses chaining for collision resolution, and an array of a prime number size for buckets. However, it chains using indexes into a separate array of a value type, probably for cache locality, rather than reference chaining.

FWIW, Java&#039;s HashMap and friends use powers of two for the bucket array, again probably to save a division, but use reference chaining.

Dictionary&#039;s implementation details may change in future releases, however; don&#039;t take this comment as part of the specification. Some parts of the implementation were constrained by details of which particular generic features in the compiler had been implemented at that time.</description>
		<content:encoded><![CDATA[<p>Julian is wrong about the linear probing versus rehashing, in so far as his comments apply to .NET and Delphi 2009, at least.</p>
<p>Delphi 2009&#8242;s TDictionary use linear probing, *not* rehashing, for collision resolution. The dictionary size is a power of two for speed of hash code -&gt; table index calculation, to avoid a division.</p>
<p>.NET&#8217;s Dictionary uses chaining for collision resolution, and an array of a prime number size for buckets. However, it chains using indexes into a separate array of a value type, probably for cache locality, rather than reference chaining.</p>
<p>FWIW, Java&#8217;s HashMap and friends use powers of two for the bucket array, again probably to save a division, but use reference chaining.</p>
<p>Dictionary&#8217;s implementation details may change in future releases, however; don&#8217;t take this comment as part of the specification. Some parts of the implementation were constrained by details of which particular generic features in the compiler had been implemented at that time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Lehmann</title>
		<link>http://delphi.org/2008/09/episode-4-julian-bucknall-part-2/comment-page-1/#comment-129</link>
		<dc:creator>Daniel Lehmann</dc:creator>
		<pubDate>Wed, 10 Sep 2008 11:37:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.delphi.org/?p=180#comment-129</guid>
		<description>Nice! Thanks for your effort.</description>
		<content:encoded><![CDATA[<p>Nice! Thanks for your effort.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: El Cy</title>
		<link>http://delphi.org/2008/09/episode-4-julian-bucknall-part-2/comment-page-1/#comment-126</link>
		<dc:creator>El Cy</dc:creator>
		<pubDate>Wed, 10 Sep 2008 07:24:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.delphi.org/?p=180#comment-126</guid>
		<description>Good job with all these podcasts !

In general, I think you should publish the full podcast (whatever length will have) instead of fragmenting it in a number of sub-episodes.</description>
		<content:encoded><![CDATA[<p>Good job with all these podcasts !</p>
<p>In general, I think you should publish the full podcast (whatever length will have) instead of fragmenting it in a number of sub-episodes.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced (User agent is rejected)
Database Caching using disk: basic

Served from: delphi.org @ 2012-05-17 07:20:42 -->
