title: Are integers faster than strings as keys for lookup tables in Javascript?
body: <p>My data returned from the backend contains a lot of referential data and I need to access it efficiently, so I'm thinking about creating (object's id) => (object itself) type lookups. The IDs for objects are returned as string and I wonder if integers are faster than strings as hash keys?</p>
  
  <pre><code>playerLookup = {};
  for (var i = 0; i &lt; players.length; i++) {
    var player = players[i];
    playerLookup[player.id] = player;
    // vs.
    playerLookup[parseInt(player.id)] = player;
  }
  </code></pre>
  
  <p>According to jsperf test <a href="http://jsperf.com/testasdfa" rel="nofollow">http://jsperf.com/testasdfa</a>, the integer lookup is considerably (~25%) faster on Chrome. Not sure if the test the scenario properly. What do you think?</p>