Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
532 changes: 532 additions & 0 deletions benchmarking.ipynb

Large diffs are not rendered by default.

164 changes: 164 additions & 0 deletions generate_randomized_input_for_benchmarking.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "486c0d66",
"metadata": {},
"outputs": [],
"source": [
"j = \"\"\"\n",
" { \n",
" \"data\" :\n",
" [\n",
" {\n",
" \"sess_pid_seq__values\" : [0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19],\n",
" \"sess_pid_seq__nnzs\" : [0,20]\n",
" }\n",
" ]\n",
" }\n",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "8d629daf",
"metadata": {},
"outputs": [],
"source": [
"import json"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "e95ca248",
"metadata": {},
"outputs": [],
"source": [
"d = json.loads(j)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "1f7836da",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'data': [{'sess_pid_seq__values': [0,\n",
" 1,\n",
" 2,\n",
" 3,\n",
" 4,\n",
" 5,\n",
" 6,\n",
" 7,\n",
" 8,\n",
" 9,\n",
" 10,\n",
" 11,\n",
" 12,\n",
" 13,\n",
" 15,\n",
" 16,\n",
" 17,\n",
" 18,\n",
" 19],\n",
" 'sess_pid_seq__nnzs': [0, 20]}]}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "f4cbfe0d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'{\"data\": [{\"sess_pid_seq__values\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19], \"sess_pid_seq__nnzs\": [0, 20]}]}'"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"json.dumps(d)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "18cfd44c",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "353b82cb",
"metadata": {},
"outputs": [],
"source": [
"data_as_dict = {'data': []}\n",
"\n",
"for i in range(10_000):\n",
" payload = {}\n",
" payload['sess_pid_seq__values'] = np.random.randint(0, 390001, 20).tolist()\n",
" payload['sess_pid_seq__nnzs'] = [0, 20]\n",
" \n",
" data_as_dict['data'].append(payload)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "ef9c5f38",
"metadata": {},
"outputs": [],
"source": [
"with open('input.json', 'w') as f:\n",
" json.dump(data_as_dict, f)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading