From b00195d498a993ec0cc4037bf34f346360e31138 Mon Sep 17 00:00:00 2001 From: Sina Dabiri Date: Tue, 7 Sep 2021 22:12:23 -0400 Subject: [PATCH] trying to profile the code with no success yet. --- .gitignore | 8 +++++ profiler.ipynb | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 .gitignore create mode 100644 profiler.ipynb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ad5a3f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.idea/ + ../.ipynb_checkpoints/ + ../Test_case/frames_BP/ + ../Test_case/results/ + __pycache__/ + output.pstats + program.prof + ../profiler.ipynb diff --git a/profiler.ipynb b/profiler.ipynb new file mode 100644 index 0000000..de644ea --- /dev/null +++ b/profiler.ipynb @@ -0,0 +1,95 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 13, + "id": "fd1b332a-1e53-427f-ab05-85e51f824016", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/mnt/c/Users/sinad/OneDrive - Georgia Institute of Technology/BMI 500 Bio Informatics/gitPractice/BPimageTranscribe/code'" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pwd" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "d8d079b1-eec8-468b-958c-b24ee3a3fe7a", + "metadata": {}, + "outputs": [], + "source": [ + "import cProfile\n", + "import re" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "a2f397d1-35f0-4637-9a93-708887479278", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 6 function calls in 0.000 seconds\n", + "\n", + " Ordered by: standard name\n", + "\n", + " ncalls tottime percall cumtime percall filename:lineno(function)\n", + " 1 0.000 0.000 0.000 0.000 :1()\n", + " 1 0.000 0.000 0.000 0.000 re.py:250(compile)\n", + " 1 0.000 0.000 0.000 0.000 re.py:289(_compile)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method builtins.exec}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method builtins.isinstance}\n", + " 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}\n", + "\n", + "\n" + ] + } + ], + "source": [ + "cProfile.run('re.compile(\"foo|bar\")')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "857557ec-2e21-44dd-a36d-32a59178dce0", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}