Open AlexTheWizardL opened 2 weeks ago
Running python profiling.py
in commit 06a32c5 on my MacBook Air M2:
Running kernprof -l -v profiling.py
in commit 06a32c5:
Profiling sanitize_journal
in commit 06a32c5 on my MacBook Air M2:
I've updated the branch with new sections that are now analyzed line-by-line at commit 01e11d0e0fe4b63e002445446e07c476ccaf6346.
The command to run profiling remains the same:
kernprof -l -v profiling.py
I've posted my profiling results below for comparison:
Based on my analysis, it appears that the primary bottleneck is now the precision()
method, which is called in all other private submethods. However, let's first confirm this by reviewing your profiling results as well.
Running the same command on my MacBook Air M2, using the full macxred accounting data:
Profiling Instructions
Preliminary Step
Before starting profiling, checkout the dedicated profiling branch:
Branch URL:
https://github.com/macxred/pyledger/tree/feat/profiling-functionality
Tools Used
pyinstrument: High-level overview of time spent across function calls. Used in major projects like Django and TensorFlow.
line_profiler + kernprof: Line-by-line timing for functions decorated with
@profile
. Standard in projects like Pandas, SciPy, and scikit-learn.Setup
Run pyinstrument for High-Level Overview
Run kernprof for Detailed Line-by-Line Timing
@profile
.@profile
decorators have already been added to the methods that are potentially the most time-consuming.About
profiling.py
The
profiling.py
file serves as the entry point for running the profiling. It is currently configured to call theaccount_balance
method to demonstrate how profiling results are collected. This entry point can be modified to target any other method or workflow that requires performance analysis.Sharing Profiling Results
You can share the profiling output by posting it as a comment under this issue.