Skip to content

Commit

Permalink
Added csv file as performance_test argument
Browse files Browse the repository at this point in the history
  • Loading branch information
fexfl committed Jan 4, 2025
1 parent 5cb790c commit 37f1f6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions notebook/batching_performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
"metadata": {},
"outputs": [],
"source": [
"def performance_test(batch_size, disp=True):\n",
"def performance_test(csv_file, batch_size, disp=True):\n",
" print(\"-----------------------------------\")\n",
" print(\"Starting performance test for batch size\", batch_size)\n",
" # create t0 timestamp\n",
" t0 = time.time()\n",
"\n",
" # import files from csv file\n",
" email_list = pd.read_csv(\"../mailcom/test/data/mails_lb_sg_copy2.csv\")\n",
" email_list = pd.read_csv(csv_file)\n",
" #print(email_list)\n",
"\n",
" t_csv_read = time.time()\n",
Expand Down Expand Up @@ -194,6 +194,7 @@
"# batching_sizes = [1]\n",
"n_samples = 5\n",
"outputs = []\n",
"csv_file = \"../mailcom/test/data/mails_lb_sg_copy2.csv\"\n",
"\n",
"# first make a dummy run since there seem to be some inconsitencies when loading for the first time\n",
"_ = performance_test(-1, disp=False)\n",
Expand All @@ -203,7 +204,7 @@
"for bs in batching_sizes:\n",
" average_email_time = 0\n",
" for sid in range(n_samples):\n",
" t, out = performance_test(bs, disp=False)\n",
" t, out = performance_test(csv_file, bs, disp=False)\n",
" average_email_time += t\n",
" test_result_dict = {\n",
" \"batch_size\": bs,\n",
Expand Down

0 comments on commit 37f1f6d

Please sign in to comment.