Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the changes made
cProfile is a built-in Python module designed for lightweight and efficient profiling of Python programs. It provides a way to analyze code performance by collecting statistics about function calls, including the number of calls, total time spent, and time per call. Using cProfile, we can pinpoint bottlenecks, identify areas for optimization, and gain insights into the runtime behavior of their Python applications. The module is particularly useful for profiling and understanding the execution flow of functions within a program, aiding in the process of code optimization and performance improvement. In this pull request, cProfile is utilized to gather profiling data, and the results are visualized using tools like SnakeViz and gprof2dot for enhanced analysis and interpretation.
SnakeViz
SnakeViz is a web-based interactive viewer for cProfile or profile (Python built-in module) output.
Profiling:
ncalls
,tottime
,percall
,cumtime
,percal
,filename:lineno(function)
Visualization Plots:
icicle
andsunburst
plots for profiling data.Definition:
Exiting the SnakeViz Server:
Ctrl + C
orCtrl + Break
Control + C
.Sample Icicle generated by SnakeViz (Trained baler for 2000 epochs)
yelp-gprof2dot
Directed Graphs (Di Graphs):
Call Graphs:
Usage:
Definition
Install Graphviz from here
Sample call graph generated by yelp-gprof2dot (Trained baler for 2000 epochs)
Replicate/Review the changes
--cProfile
flagThe profiled outputs and plots will be stored at the location:
workspaces/CFD_workspace/CFD_project_animation/output/profiling/