summaryrefslogtreecommitdiff
path: root/topics/python/profiling_python_code.gmi
diff options
context:
space:
mode:
authorPjotr Prins2023-12-03 09:43:06 -0600
committerPjotr Prins2023-12-03 09:43:06 -0600
commitaa3d310aa257f0ef0a8636272883c3c4e6855a1c (patch)
tree9ac85bf43abd92f897dc801e7515daaff5232120 /topics/python/profiling_python_code.gmi
parentf63f9df201c3ae57ad8b52cf5127995c82944be7 (diff)
downloadgn-gemtext-aa3d310aa257f0ef0a8636272883c3c4e6855a1c.tar.gz
Moving files
Diffstat (limited to 'topics/python/profiling_python_code.gmi')
-rw-r--r--topics/python/profiling_python_code.gmi28
1 files changed, 28 insertions, 0 deletions
diff --git a/topics/python/profiling_python_code.gmi b/topics/python/profiling_python_code.gmi
new file mode 100644
index 0000000..9052364
--- /dev/null
+++ b/topics/python/profiling_python_code.gmi
@@ -0,0 +1,28 @@
+# Profiling Python code
+
+As part of improving the system, there is need to identify and fix/improve the performance bottlenecks in the code. This document details examples of how one would run various profilers, for both GeneNetwork2 and GeneNetwork3
+
+## GeneNetwork3
+
+### cProfile
+
+Syntax:
+
+* env [various-env-vars] python3 -m cProfile the-script.py
+
+where
+
+* `[various-env-vars]` is a number of environment variables that might be needed for the running of the script, e.g. `SQL_URI` which is used to define how to connect to the database.
+* `the-script.py` is the name of the python script to be run under the profiler
+
+The output can be redirected, e.g.
+
+* env [various-env-vars] python3 -m cProfile the-script.py 2>error.log 1>performance.log
+
+which should help will separating errors from the performance data, for easier analysis
+
+
+## Tags
+
+* type: documentation
+* keywords: profiling, python