In [1]:
import numpy as np
from gth_solve_jit import gth_solve, gth_solve_jit

In [2]:
sizes = [10, 50, 100, 1000]
rand_matrices = []

for n in sizes:
    Q = np.random.rand(n, n)
    Q /= np.sum(Q, axis=1, keepdims=True)
    rand_matrices.append(Q)

In [3]:
for i, Q in enumerate(rand_matrices):
    print 'rand_matrices[{0}] ({1} x {2})'.format(i, Q.shape[0], Q.shape[1])
    %timeit gth_solve(Q)
    %timeit gth_solve_jit(Q)
    %timeit gth_solve_jit(Q, overwrite=True)


rand_matrices[0] (10 x 10)
10000 loops, best of 3: 112 µs per loop
100000 loops, best of 3: 3.67 µs per loop
100000 loops, best of 3: 3.21 µs per loop
rand_matrices[1] (50 x 50)
1000 loops, best of 3: 732 µs per loop
10000 loops, best of 3: 64.5 µs per loop
10000 loops, best of 3: 61.5 µs per loop
rand_matrices[2] (100 x 100)
100 loops, best of 3: 2.46 ms per loop
1000 loops, best of 3: 442 µs per loop
1000 loops, best of 3: 434 µs per loop
rand_matrices[3] (1000 x 1000)
1 loops, best of 3: 2.02 s per loop
1 loops, best of 3: 426 ms per loop
1 loops, best of 3: 422 ms per loop

In [4]:
import platform
print platform.platform()


Darwin-13.4.0-x86_64-i386-64bit

In [5]:
import sys
print sys.version


2.7.8 |Anaconda 2.1.0 (x86_64)| (default, Aug 21 2014, 15:21:46) 
[GCC 4.2.1 (Apple Inc. build 5577)]

In [6]:
print np.__version__


1.9.0

In [7]:
import numba
print numba.__version__


0.14.0

In [7]: