title: Why does this connection code take almost 5 seconds to run?
body: <pre><code>var MongoClient = require('mongodb').MongoClient
  
  var perf = 0
  , interval = setInterval(function(){
    perf++;
  }, 0);
  
  var url = 'mongodb://localhost:27017/test';
  MongoClient.connect(url, function(err, db) {
  
    console.log("Finished after", ( perf / 1000 ), "seconds" );
    clearInterval(interval);
  
  });
  </code></pre>
  
  <p>Average output</p>
  
  <pre><code>Finished after 4.343 seconds
  </code></pre>
  
  <p>Why is it so ridiculously slow? How can I identify the bottle neck and fix this?</p>
  
  <p>Running on OS X 10.9.5 with the following versions:</p>
  
  <pre><code>Node v0.10.33
  npm  1.4.28
  MongoDB shell version: 2.4.6
  </code></pre>