Added basic profiling
This commit is contained in:
parent
bdef152dac
commit
e2539cd396
1 changed files with 16 additions and 16 deletions
30
.github/workflows/profiling.yaml
vendored
30
.github/workflows/profiling.yaml
vendored
|
|
@ -68,21 +68,21 @@ jobs:
|
||||||
- name: Compare profiling results
|
- name: Compare profiling results
|
||||||
run: |
|
run: |
|
||||||
python -c "
|
python -c "
|
||||||
import json
|
import json
|
||||||
try:
|
try:
|
||||||
with open('base_results.json') as f:
|
with open('base_results.json') as f:
|
||||||
base = json.load(f)
|
base = json.load(f)
|
||||||
with open('head_results.json') as f:
|
with open('head_results.json') as f:
|
||||||
head = json.load(f)
|
head = json.load(f)
|
||||||
cpu_diff = head.get('total_cpu_samples_python', 0) - base.get('total_cpu_samples_python', 0)
|
cpu_diff = head.get('total_cpu_samples_python', 0) - base.get('total_cpu_samples_python', 0)
|
||||||
memory_diff = head.get('malloc_samples', 0) - base.get('malloc_samples', 0)
|
memory_diff = head.get('malloc_samples', 0) - base.get('malloc_samples', 0)
|
||||||
with open('profiling_diff.txt', 'w') as f:
|
with open('profiling_diff.txt', 'w') as f:
|
||||||
f.write(f'CPU Usage Difference: {cpu_diff}\\n')
|
f.write(f'CPU Usage Difference: {cpu_diff}\\n')
|
||||||
f.write(f'Memory Usage Difference: {memory_diff} bytes\\n')
|
f.write(f'Memory Usage Difference: {memory_diff} bytes\\n')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
with open('profiling_diff.txt', 'w') as f:
|
with open('profiling_diff.txt', 'w') as f:
|
||||||
f.write(f'Error comparing profiling results: {e}\\n')
|
f.write(f'Error comparing profiling results: {e}\\n')
|
||||||
"
|
"
|
||||||
|
|
||||||
# Post results to the pull request
|
# Post results to the pull request
|
||||||
- name: Post profiling results to PR
|
- name: Post profiling results to PR
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue