title: C# Dictionary: faster access but less memory footprint
body: <p>I want some advise on the best way to store and access with minimum memory footprint and maximum access performance.</p>
  
  <p>Eg.
  for each vehicle make i want to store model and name.</p>
  
  <p>i have some thoughts below:</p>
  
  <p>Option 1:</p>
  
  <pre><code>Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt; values = new Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt;();
  Dictionary&lt;string, string&gt; list = new Dictionary&lt;string, string&gt;();
  list.Add("2001", "Jetta S");
  list.Add("2002", "Jetta SE");
  list.Add("2002", "Jetta LE");
  values.Add("VolksWagen", list);
  </code></pre>
  
  <p>Option 2:</p>
  
  <pre><code>Dictionary&lt;string, List&lt;KeyValuePair&lt;string, string&gt;&gt;&gt; values2 = new Dictionary&lt;string, List&lt;KeyValuePair&lt;string, string&gt;&gt;&gt;();
  &lt;pre lang="xml"&gt;List&lt;KeyValuePair&lt;string, string&gt;&gt; list2 = new List&lt;KeyValuePair&lt;string, string&gt;&gt;();
  list2.Add(new KeyValuePair&lt;string, string&gt;("2001", "Jetta S"));
  list2.Add(new KeyValuePair&lt;string, string&gt;("2002", "Jetta SE"));
  list2.Add(new KeyValuePair&lt;string, string&gt;("2002", "Jetta LE"));
  values2.Add("VolksWagen", list2);
  </code></pre>
  
  <p>Option 3:</p>
  
  <pre><code>Dictionary&lt;string, List&lt;string&gt;&gt; values1 = new Dictionary&lt;string, List&lt;string&gt;&gt;();
  List&lt;string&gt; list1 = new List&lt;string&gt;();
  list1.Add("2001:Jetta S");
  list1.Add("2002:Jetta SE");
  list1.Add("2002:Jetta LE");
  values1.Add("VolksWagen", list1);
  </code></pre>
  
  <ul>
  <li>Option 1: faster access of make and
  name but most memory footprint </li>
  <li>Option 2: fast access of make and
  name but    more memory footprint</li>
  <li>Option 3: slow    access of make and
  name (would have    to parse it) but
  less memory    footprint</li>
  </ul>
  
  <p>there would be more than 1500 dictionaries like above.</p>
  
  <p>Any suggestions for fastest access but less memory footprint is appreciated?</p>
  
  <p>Thanks.</p>