title: Autoboxing versus manual boxing in Java
body: <p>Why is the second piece of code faster?</p>
  
  <pre><code>Map&lt;Integer, Double&gt; map = new HashMap&lt;Integer, Double&gt;();
  for (int i = 0; i &lt; 50000; i++) {
      for (double j = 0.0; j &lt; 10000; j++) {
          map.put(i, j);
      }
  }
  
  Map&lt;Integer, Double&gt; map=new HashMap&lt;Integer, Double&gt;();
  for (int i = 0; i &lt; 50000; i++) {
      for (double j = 0.0; j &lt; 10000; j++) {            
          map.put(new Integer(i), new Double(j));
      }
  }
  </code></pre>