title: Multiply function slower in Numba than CPython
body: <p>I wrote the following code in python</p>
  
  <pre><code>from numba import *
  
  def mul(a, b):
      return a * b
  
  @jit
  def numba_mul(a, b):
      return a * b
  
  
  @jit(int_(int_, int_))
  def numba_mul2(a, b):
      return a * b
  </code></pre>
  
  <p>and got the following result</p>
  
  <pre><code>In [3]: %timeit mul(10, 10)
  10000000 loops, best of 3: 124 ns per loop
  
  In [4]: %timeit numba_mul(10, 10)
  1000000 loops, best of 3: 271 ns per loop
  
  In [5]: %timeit numba_mul2(10, 10)
  1000000 loops, best of 3: 263 ns per loop
  </code></pre>
  
  <p>Why is CPython more than 2x as fast as Numba? This is in Python 2.7.7 on OSX 10.9.3 with LLVM 3.2</p>
  
  <p>If it helps, the llvm dump (obtained using numba --annotate --llvmp-dump main.py) is below</p>
  
  <pre><code>----------------LLVM DUMP &lt;function descriptor 'numba_mul2$30'&gt;-----------------
  ; ModuleID = 'module.numba_mul2$30'
  
  define i32 @numba_mul2.int64.int64(i64*, i64 %arg.a, i64 %arg.b) {
  entry:
    %a = alloca i64
    store i64 %arg.a, i64* %a
    %b = alloca i64
    store i64 %arg.b, i64* %b
    %a.1 = alloca i64
    %b.1 = alloca i64
    %"$0.1" = alloca i64
    br label %B0
  
  B0:                                               ; preds = %entry
    %1 = load i64* %a
    store i64 %1, i64* %a.1
    %2 = load i64* %b
    store i64 %2, i64* %b.1
    %3 = load i64* %a.1
    %4 = load i64* %b.1
    %5 = mul i64 %3, %4
    store i64 %5, i64* %"$0.1"
    %6 = load i64* %"$0.1"
    store i64 %6, i64* %0
    ret i32 0
  }
  
  !python.module = !{!0}
  
  !0 = metadata !{metadata !"__main__"}
  
  ================================================================================
  -----------------------------------ANNOTATION-----------------------------------
  # File: main.py
  # --- LINE 30 --- 
  
  @jit(int_(int_, int_))
  
  # --- LINE 31 --- 
  
  def numba_mul2(a, b):
  
      # --- LINE 32 --- 
      # label 0
      #   a.1 = a  :: int64
      #   b.1 = b  :: int64
      #   $0.1 = a.1 * b.1  :: int64
      #   return $0.1
  
      return a * b
  
  
  ================================================================================
  </code></pre>