update puzzle with values from benchmark_python
This commit is contained in:
parent
3357e17e4f
commit
7a46f3c939
14
puzzle.ipynb
14
puzzle.ipynb
|
@ -31,8 +31,8 @@
|
|||
"source": [
|
||||
"# create a collection of time series\n",
|
||||
"# in real life, this data comes from an experiment/simulation\n",
|
||||
"n_series = 30\n",
|
||||
"len_one_series = 2**21 # ➔ 2^21 ≈ 2 millions (8Bytes x 2^21/2^20 [MB] = 16 MB)\n",
|
||||
"n_series = 128\n",
|
||||
"len_one_series = 2**15 # ➔ 2^15 = 32768 items (8 B x 2^15 = 262144 B = 256 K)\n",
|
||||
"time_series = []\n",
|
||||
"for idx in range(n_series):\n",
|
||||
" time_series.append(np.zeros((len_one_series,1), dtype='float64'))"
|
||||
|
@ -52,9 +52,9 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# how much memory does one time series need?\n",
|
||||
"ts_size = time_series[0].nbytes/2**20 # -> 2^20 is 1MB\n",
|
||||
"print('Size of one time series (MB):', ts_size)\n",
|
||||
"print('Size of collection (MB):', n_series*ts_size)"
|
||||
"ts_size = time_series[0].nbytes/2**10 # -> 2^10 is 1 K\n",
|
||||
"print(f'Size of one time series: {int(ts_size)} K')\n",
|
||||
"print(f'Size of collection: {int(n_series*ts_size/1024)} M')"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -138,7 +138,9 @@
|
|||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"source": [
|
||||
"# on my machine: 2.2 ms vs 33.9 ms ≈ 15x slowdown!!!"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
Loading…
Reference in a new issue