title: JS handling objects with long keys
body: <p>I have a question about how JS handles cases likes this.</p>
  
  <p>Ley's say you have an empty object:</p>
  
  <pre><code>var object = {};
  </code></pre>
  
  <p>And an XML in memory as an string:</p>
  
  <pre><code>var xml = '&lt;node1&gt;&lt;node2&gt;blah blah....';
  </code></pre>
  
  <p>Now you want to associate that XML with some information, so you could do something like:</p>
  
  <pre><code>object[xml] = 'extra info';
  </code></pre>
  
  <p>Imagine you have several more XMLs, so that object will have N properties, with potentially long strings as keys, and other objects as values.</p>
  
  <p>The questions are how JS handles the access to these properties by keys (this means knowing the XML), and how performant is it. Is it just an iteration over the keys comparing the strings or there is something else happening?</p>
  
  <p>Thanks!</p>
  
  <p>Edit: To clarify, this is not something I want to do, but something that a library I use (Moustache.js) is doing, as you can see <a href="https://github.com/janl/mustache.js/blob/master/mustache.js#L441-L453" rel="nofollow">here</a>. I want to know how this affects the performance of my application.</p>