title: Memory efficient std::map alternative
body: <p>I'm using a <code>std::map</code> to store about 20 million entries. If they were stored without any container overhead, it would take approximately 650MB of memory. However, since they are stored using <code>std::map</code>, it uses up about 15GB of memory (i.e. too much).</p>
  
  <p>The reason I am using an <code>std::map</code> is because I need to find keys that are equal to/larger/smaller than <code>x</code>. This is why something like <code>sparsehash</code> wouldn't work (since, using that, I cannot find keys by comparison).</p>
  
  <p>Is there an alternative to using <code>std::map</code> (or ordered maps in general) that would result in less memory usage?</p>
  
  <p>EDIT: Writing performance is <em>much</em> more important than reading performance. It will probably only read ~10 entries, but I don't know which entries it will read.</p>