title: Why were pandas merges in python faster than data.table merges in R in 2012?
body: <p>I recently came across the <a href="http://pandas.sourceforge.net/" rel="noreferrer">pandas</a> library for python, which according to <a href="http://wesmckinney.com/blog/some-pandas-database-join-merge-benchmarks-vs-r-basemerge/" rel="noreferrer">this benchmark</a> performs very fast in-memory merges.  It's even faster than the <a href="http://cran.r-project.org/web/packages/data.table/index.html" rel="noreferrer">data.table</a> package in R (my language of choice for analysis).</p>
  
  <p>Why is <code>pandas</code> so much faster than <code>data.table</code>?  Is it because of an inherent speed advantage python has over R, or is there some tradeoff I'm not aware of?  Is there a way to perform inner and outer joins in <code>data.table</code> without resorting to <code>merge(X, Y, all=FALSE)</code> and <code>merge(X, Y, all=TRUE)</code>?</p>
  
  <p><img src="https://i.stack.imgur.com/0pCvh.png" alt="Comparison"></p>
  
  <p>Here's the <a href="https://github.com/wesm/pandas/blob/master/bench/bench_merge.R" rel="noreferrer">R code</a> and the <a href="https://github.com/wesm/pandas/blob/master/bench/bench_merge.py" rel="noreferrer">Python code</a> used to benchmark the various packages.</p>