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
sdb = connect()
def profile(n):
x = sdb.random(n)
t0 = time()
y = x.toarray()
return time() - t0
x = np.array([10**3, 10**4, 10**5, 10**6, 10**7])
y = [profile(sz) for sz in x]
plt.plot(x, x / np.array(y), 'ko-')
plt.xscale('log')
plt.yscale('log')
plt.xlabel('Array size')
plt.ylabel('Transfer / (elements/sec)')
<matplotlib.text.Text at 0x10e18b790>