In [20]:
from time import time

import numpy as np
from scidbpy import connect
%matplotlib inline

import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (8, 8)
plt.rcParams['figure.dpi'] = 500
plt.rcParams['font.size'] = 14
In [3]:
sdb = connect()
In [5]:
def profile(n):
    x = sdb.random(n)
    t0 = time()
    y = x.toarray()
    return time() - t0
In [22]:
x = np.array([10**3, 10**4, 10**5, 10**6, 10**7])
y = [profile(sz) for sz in x]
In [23]:
plt.plot(x, x / np.array(y), 'ko-')
plt.xscale('log')
plt.yscale('log')
plt.xlabel('Array size')
plt.ylabel('Transfer / (elements/sec)')
Out[23]:
<matplotlib.text.Text at 0x10e18b790>