﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Josh commented on Dictionary&lt;Enum,T&gt; Puzzler</title><description>Well 1) you could forego the default comparison mechanism by supplying your own IComparer
&lt;t in the dictionary's constructor
  
2) It always bothered me that the CLR can't provide default implementations for IEquatable
&lt;t and GetHashCode() for value types based on its binary structure.
&gt;</description><link>http://ayende.com/3885/dictionary-enum-t-puzzler#comment7</link><guid>http://ayende.com/3885/dictionary-enum-t-puzzler#comment7</guid><pubDate>Sun, 22 Feb 2009 03:51:36 GMT</pubDate></item><item><title>firefly commented on Dictionary&lt;Enum,T&gt; Puzzler</title><description>I am more interested on how to identify the bottleneck in the first place.
</description><link>http://ayende.com/3885/dictionary-enum-t-puzzler#comment6</link><guid>http://ayende.com/3885/dictionary-enum-t-puzzler#comment6</guid><pubDate>Sun, 22 Feb 2009 01:44:12 GMT</pubDate></item><item><title>Omer Mor commented on Dictionary&lt;Enum,T&gt; Puzzler</title><description>Simone is right, and I'll update my article soon.
  
The general solution is still valid: overcoming generics' shortcoming using dynamic code generation.
  
Simone's idea is to use Expression Trees to generate the code instead of Lightweight Code Generation (DynamicMethod), which makes the code clearer (no need for IL).
  
LCG is still useful when you can't use .Net 3.5 &amp; C#3.
  
  
  Omer Mor
</description><link>http://ayende.com/3885/dictionary-enum-t-puzzler#comment5</link><guid>http://ayende.com/3885/dictionary-enum-t-puzzler#comment5</guid><pubDate>Sat, 21 Feb 2009 20:41:17 GMT</pubDate></item><item><title>Simone commented on Dictionary&lt;Enum,T&gt; Puzzler</title><description>It can be accomplished in 10 lines with C# 3.0, I posted a comment on the article, I think it's been updated.
</description><link>http://ayende.com/3885/dictionary-enum-t-puzzler#comment4</link><guid>http://ayende.com/3885/dictionary-enum-t-puzzler#comment4</guid><pubDate>Sat, 21 Feb 2009 18:55:04 GMT</pubDate></item><item><title>Gil Fink commented on Dictionary&lt;Enum,T&gt; Puzzler</title><description>Thanks for sharing!
</description><link>http://ayende.com/3885/dictionary-enum-t-puzzler#comment3</link><guid>http://ayende.com/3885/dictionary-enum-t-puzzler#comment3</guid><pubDate>Sat, 21 Feb 2009 10:47:09 GMT</pubDate></item><item><title>Ayende Rahien commented on Dictionary&lt;Enum,T&gt; Puzzler</title><description>The problem isn't with the number of elements, the problem is with the number of comparisions!
  
</description><link>http://ayende.com/3885/dictionary-enum-t-puzzler#comment2</link><guid>http://ayende.com/3885/dictionary-enum-t-puzzler#comment2</guid><pubDate>Sat, 21 Feb 2009 06:03:43 GMT</pubDate></item><item><title>Dmitry commented on Dictionary&lt;Enum,T&gt; Puzzler</title><description>Is this really an issue with a generic dictionary? How many values can an enum have in real life, 10-15?
</description><link>http://ayende.com/3885/dictionary-enum-t-puzzler#comment1</link><guid>http://ayende.com/3885/dictionary-enum-t-puzzler#comment1</guid><pubDate>Sat, 21 Feb 2009 05:00:59 GMT</pubDate></item></channel></rss>