You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-1
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ With `pdb++`, add breakpoints again with `breakpoint()`. You may run `sticky` in
118
118
119
119
For debugging code with a graphical interface, check [pudb](https://documen.tician.de/pudb/starting.html) (similar usage).
120
120
121
-
## Performance analysis
121
+
## Performance analysis with FlameGraph
122
122
123
123
Checking how much time is spent forevery function. Can help you to find the bottleneckin your code.
124
124
[FlameGraph](https://github.com/brendangregg/FlameGraph) is a nice visual tool to display your stack trace.
@@ -173,6 +173,25 @@ cd <cloned-flamegraph-repo>
173
173
174
174
As the process with the default flamegraph repo is quite a pain, you can write your own script like @ManifoldFR in [proxDDP](https://github.com/Simple-Robotics/proxddp/blob/wj/nnl-rollout/scripts/make_flamegraph.sh).
175
175
176
+
## Performance analysis with Tracy Profiler
177
+
Tracy is a real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications that comes with a nice [documentation](https://github.com/wolfpld/tracy/releases/latest/download/tracy.pdf).
178
+
You can checkout the interactive [demo](https://tracy.nereid.pl/).
179
+
180
+
To use it in your project, you can follow the same steps as in pinocchio or simple:
181
+
1. Install it via: `conda install tracy-profiler tracy-profiler-gui -c conda-forge`
182
+
2. Include `tracy.cmake` from jrl-cmakemodules in your main CMakeLists file
183
+
3. Add tracy as project dependency e.g.
184
+
```cmake
185
+
if(PROJECT_NAME_BUILD_WITH_TRACY)
186
+
# assume it is installed somewhere
187
+
add_project_dependency(Tracy REQUIRED)
188
+
endif(PROJECT_NAME_BUILD_WITH_TRACY)
189
+
```
190
+
4. In your code: `#include "project_name/tracy.hpp"` and use `PROJECT_NAME_TRACY_ZONE_SCOPED_N("NAME_OF_ZONE")` , where project_name should be replaced by your actual project name.
191
+
See [here](https://github.com/jrl-umi3218/jrl-cmakemodules/blob/b5ae8e49306840a50ae9c752c5b4040f892c89d8/tracy.hh.cmake) for all macros.
192
+
193
+
After specifying the code segments you wish to monitor with Tracy, execute `tracy-profiler` from the command line (ensure your conda environment is active). Run your benchmark files and review the various statistics in the GUI. Note that if you are benchmarking on a remote server, you can connect to it using `ssh user@remote -X` to display the Tracy GUI on your screen.
194
+
176
195
## Finding memory leaks
177
196
178
197
[Valgrind](https://valgrind.org/) can automatically detect many memory management and threading bugs.
0 commit comments